akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define MOD 1000000007
#define INF (1<<30)
#define LINF (1LL<<60)
#define endl "\n"
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define reprev(i,n) for(int (i)=(n-1);(i)>=0;(i)--)
#define Flag(x) (1<<(x))
#define Flagcount(x) __builtin_popcount(x)
#define pint pair<int,int>
#define pdouble pair<double,double>
typedef unsigned long long int ull;
typedef long long lint;
 
int main(void){
    int N,K;
    cin >> N >> K;
    int x[N];
    rep(i,N) cin >> x[i];
    int ans=INF;
    for(int i=0;i<N-K+1;i++){
        int dis;
        if((x[i]<=0 && x[i+K-1]<=0) || (x[i]>=0 && x[i+K-1]>=0)) dis=max(abs(x[i]),abs(x[i+K-1]));
        else dis=max(abs(x[i]),abs(x[i+K-1]))+2*min(abs(x[i]),abs(x[i+K-1]));
        ans=min(ans,dis);
    }
    cout << ans << endl;
}

Measured memory_bytes: 640
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
typedef long long ll;
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
using namespace std;
const ll MOD=998244353,MAX_N=1e5;
ll N,D[MAX_N],cnt[MAX_N];
ll mpw(ll n,ll m,ll mod){
	ll ret=1;
	REP(i,m){
		ret*=n;
		ret%=mod;
	}
	return ret;
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>N;
	REP(i,N){
		cin>>D[i];
		cnt[D[i]]++;
	}
	ll ans=1;
	if(D[0]!=0){
		ans=0;
	}else if(cnt[0]!=1){
		ans=0;
	}
	ll mx;
	REP(i,N){
		if(cnt[N-1-i]!=0){
			mx=N-1-i;
			break;
		}
	}
	FOR(i,1,mx){
		ans*=mpw(cnt[i],cnt[i+1],MOD);
		ans%=MOD;
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 1792
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7 # 998244353
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    n, m = map(int,input().split())
    H = list(map(int,input().split()))
    E = [[] for _ in range(n)]
    for _ in range(m):
        u, v = map(int,input().split())
        u -= 1; v -= 1
        E[u].append(v)
        E[v].append(u)

    res = [None] * n
    for v in range(n):
        res[v] = all(H[v] > H[nv] for nv in E[v])
    print(sum(res))
resolve()

Measured memory_bytes: 90888
use std::io::*;
use std::i64;
use std::str::FromStr;
 
/* 
The read function reads a string according to each one. 
*/
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}


//main function
fn main() {
    let mut a: i64 = read();
    let mut b: i64 = read();
    let t: i64;
    if a<b {
	t = a;
	a = b;
	b = t;
    }
    if (a-b)%2 != 0 {
	println!("IMPOSSIBLE");
    }else {
	if a%2 == 0{
	    println!("{}",(a/2)+(b/2));
	}else{
	    println!("{}",(a/2)+(b/2)+1);
	}
    }
}


Measured memory_bytes: 4352
#include <stdio.h>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
#include <functional>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef vector<vector<int>> v2int;
typedef vector<ll> vll;
typedef vector<vector<ll>> v2ll;
typedef list<int> liint;
typedef pair<int, int> pint;
const int INF = int(2e9);
const ll LINF = ll(2e9) * ll(2e9);
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b) { a > b ? : a = b; }
template<class T, class C> void chmin(T& a, C b) { a < b ? : a = b; }

int bit_num(int t) {
    int ans = 0;
    rep(i, 32) {
        if ((t >> i) & 0x01 != 0) ans++;
    }
    return ans;

}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int H, W, K;
    cin >> H >> W >> K;
    vector<vector<char>> field(H, vector<char>(W));
    rep(i, H) {
        rep(j, W) cin >> field[i][j];
    }
    int ans = INF;
    rep(i, 1 << (H - 1)) {
        v2int sum_num(H, vint(W + 1));
        
        rep(j, W) {
            int cnt = 0;
            int t = 0;
            rep(k, H) {
                if (field[k][j] == '1') cnt++;
                if (((i >> k) & 0x01) != 0 || k == H - 1) {
                    sum_num[t][j + 1] = sum_num[t][j] + cnt;
                    cnt = 0;
                    t++;
                }
            }
        }
        
        bool is_cont = false;
        REP(j, 1, W + 1) {
            int max_num = 0;
            rep(k, H) {
                max_num = max(sum_num[k][j] - sum_num[k][j - 1], max_num);
            }
            if (max_num > K) {
                is_cont = true;
                break;
            }
        }

        if (is_cont == true) {
            continue;
        }

        int cost = 0;
        int div = 0;
        int j = 1;

        while(j <= W) {
            int max_num = 0;
            rep(k, H) {
                max_num = max(sum_num[k][j] - sum_num[k][div], max_num);
            }
            if (max_num > K) {
                cost++;
                div = j - 1;
            }
            else {
                j++;
            }
        }
        ans = min(cost + bit_num(i), ans) ;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <bits/stdc++.h>
#define ll long long int
#define m 1000000007
using namespace std;
int main()
{
    int t;
    t=1;
    while(t--)
    {
        string s;
        cin >> s;
        int n=s.length();
        if(s[n-1]=='s')
        {
            cout << s << 'e' << 's';
        }
        else
        {
            cout << s << 's';
        }
    }
	return 0;
}

Measured memory_bytes: 3588
// I'm a f*cking looser
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fasino ios_base::sync_with_stdio(false); cin.tie(0);  cout.tie(0);
#define input(A) for(auto &i:A) cin>>i;
signed main()
{
    fasino
    double n;
    cin>>n;
    long double k = n/3;
    cout<<fixed<<setprecision(7)<<k*k*k;
    return 0;
}

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

void solve(long long N, std::vector<long long> A){
    bool check = true;
    for(ll i = 0; i < N; ++i){
        if(A[i] % 2 == 0){
            if(A[i] % 3 == 0 || A[i] % 5 == 0) continue;
            else{
                check = false;
                break;
            }
        }
    }
    if(check) cout << "APPROVED" << endl;
    else cout << "DENIED" << endl;
    return;
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }
    solve(N, std::move(A));
    return 0;
}


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

#define rep(i, n) for(int i=0; i < n; i++)
#define REP(i, n, m) for(int i=n; i < m; i++)
#define reps(i, n) for(int i=1; i <= n; i++)
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)

using namespace std;
using ll=long long;

ll mod=1;

const ll INF = 1LL << 60;

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

// a^n mod を計算 再帰
ll modpow(ll a,ll n,ll &mod){
  if(!n) return 1;
  ll x = modpow(a,n/2,mod)%mod;
  x *=x;
  if(n%2==1)x*=a;
  return x%mod;
}

char board[55][55];
int dx[4]={-1,0,0,1};
int dy[4]={0,-1,1,0};

int main(){
  int h,w;cin>>h>>w;
  rep(i,55)rep(j,55)board[i][j]='.';
  reps(i,h)reps(j,w)cin>>board[i][j];
  reps(i,h)reps(j,w)if(board[i][j]=='#'){
    rep(k,4){
      int x=j+dx[k];
      int y=i+dy[k];
      if(board[y][x]=='#')break;
      if(k==3){cout<<"No";return 0;}
    }
  }
  cout<<"Yes";
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <algorithm>
using namespace std;

int main(){
	string s1, s2, s3;
	cin >> s1 >> s2 >> s3;

	cout << (char)toupper(s1.at(0)) << (char)toupper(s2.at(0)) << (char)toupper(s3.at(0)) << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

using namespace std;
//using namespace __gnu_pbds;
//typedef tree<
//        pair<int, int>, // change type
//        null_type,
//        less<pair<int, int> >, // change type
//        rb_tree_tag,
//        tree_order_statistics_node_update>
//        ordered_set;

typedef long long ll;
#define rep(i, start, end) for(int i = start; i < end; ++i)
#define sz(x) (int)(x).size()
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(d, v) memset(d, v, sizeof(d))
#define pii pair<int, int>
const double PI = 3.14159265358979323846;
const double eps = (1e-8);

int n, m;
int needGeneral[10] = {0,2, 5, 5, 4, 5, 6, 3, 7, 6};
vector<int> need, dig, allZeros, negativeInfinity;

vector<int> mem[12][10005];



void findMax(vector<int> &a, vector<int> b, int idx, int cntTaken)
{
    b[idx] += cntTaken;
    b[m] += cntTaken;
    if (a[m] > b[m])
    {
        return;
    }
    else if (a[m] < b[m])
    {
        a = b;
        return;
    }
    for (int i = 0; i < m; ++i)
    {
        if (a[i] > b[i])
        {
            return;
        }
        if (a[i] < b[i]){
            a = b;
            return;
        }
    }
    return;
}


vector<int> solve(int i, int rem) // v size is always m + 1 v[m] is amount of digits and v[0, m-1] is amount taken of this digit
{
    if (i == m)
    {
        if (!rem)
            return allZeros;
        return negativeInfinity;
    }
    vector<int> &ret = mem[i][rem];
    if (ret[0] != -1)
        return ret;
    ret = solve(i + 1, rem);
    if (rem >= need[i])
        findMax(ret, solve(i, rem - need[i]), i, 1);

    return ret;
}


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
#ifndef ONLINE_JUDGE
//    freopen("input.txt", "r", stdin);
//    freopen("facebook.txt", "w", stdout);
#endif
    cin >> n >> m;
    rep(i,0,m + 1)
    {
        rep(j,0,n + 1)
            mem[i][j].resize(m + 1, -1); // m digits and number of digits
    }
    allZeros.resize(m + 1);
    negativeInfinity.resize(m + 1, -1000);
    dig.resize(m);
    rep(i,0,m)
        cin >> dig[i];
    sort(dig.rbegin(), dig.rend());
    need.resize(m);
    rep(i,0,m)
        need[i] = needGeneral[dig[i]];
    vector<int> ans = solve(0, n);
    rep(i,0,sz(ans) - 1){
        rep(j,0,ans[i])
            cout << dig[i];
    }
    return  0;
}

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

int main(){
    int N; cin >> N;
    vector<int> d(N);
    rep(i, N) cin >> d[i];

    map<int,int> mp;
    rep(i, N){
        mp[d[i]]++;
        if(mp[d[i]] > 2 || d[i] == 0){
            cout << 0 << endl;
            return 0;
        }
    }
    if(mp[12] > 1 || N > 24){cout << 0 << endl; return 0;}
    int ans = 0;
    vector<int> dist, u;
    for(auto e: mp){
        if(e.second == 2){
            dist.push_back(e.first);
            dist.push_back(24 - e.first);
        }else if(e.second == 1){
            //cout << e.first << e.second << endl;
            u.push_back(e.first);
        }
    }
    sort(dist.begin(), dist.end());
    //for(auto e: u) cout << e << endl;

    int k = u.size();

    for(int i = 0; i < 1 << k; i++){
        vector<int> tmp = dist;
        int tans = 12;
        tmp.push_back(0);
        for(int j = 0; j < k; j++){
            if(i & j) tmp.push_back(u[j]);
            else tmp.push_back(24-u[j]);
        }
        sort(tmp.begin(), tmp.end());
        tmp.push_back(24);
        for(int j = 1; j < tmp.size(); j++){
            //cout << tmp[j] << tmp[j-1] << endl;
            tans = min(tans, tmp[j] - tmp[j-1]);
        }
        ans = max(ans, tans);
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define PB push_back
#define MP make_pair
#define ff first
#define ss second
#define pri 1000000007 
using namespace std;

int main() {
	
   ll n,m;
   cin>>n>>m;
   ll ass[n+2]={0};
  for(ll i=0;i<m;i++){
  	ll x,y;
  	cin>>x>>y;
  	ass[x]++;
  	ass[y+1]--;
  }
  ll pre=0,ans=0;
  for(ll i=1;i<=n;i++){
  	pre+=ass[i];
  	if(pre==m)ans++;
  }
  cout<<ans<<endl;
 

	// your code goes here
	return 0;
}

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

#define NDEBUG
#ifdef DEBUG
#include "../cout11.h"
#undef NDEBUG
#endif
#include <cassert>

typedef long long ll;
typedef long double Double;
typedef unsigned long long ull;
typedef pair<int,int> ii;
typedef pair<ll,ll> llll;
typedef pair<double,double> dd;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ii> vii;
typedef vector<vector<ii>> vvii;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<long double> vD;

#define sz(a)  int((a).size())
#define pb  push_back
#define FOR(var,from,to) for(int var=(from);var<=(to);++var)
#define rep(var,n)  for(int var=0;var<(n);++var)
#define rep1(var,n)  for(int var=1;var<=(n);++var)
#define repC2(vari,varj,n)  for(int vari=0;vari<(n)-1;++vari)for(int varj=vari+1;varj<(n);++varj)
#define ALL(c)  (c).begin(),(c).end()
#define RALL(c)  (c).rbegin(),(c).rend()
#define tr(i,c)  for(auto i=(c).begin(); i!=(c).end(); ++i)
#define found(s,e)  ((s).find(e)!=(s).end())
#define mset(arr,val)  memset(arr,val,sizeof(arr))
#define mid(x,y) ((x)+((y)-(x))/2)
#define IN(x,a,b) ((a)<=(x)&&(x)<=(b))

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

const ll MOD=1000000007LL;

ll ADD(ll x, ll y) { return (x+y) % MOD; }
ll SUB(ll x, ll y) { return (x-y+MOD) % MOD; }
ll MUL(ll x, ll y) { return x*y % MOD; }
ll POW(ll x, ll e) { ll v=1; for(; e; x=MUL(x,x), e>>=1) if (e&1) v = MUL(v,x); return v; }
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD-2)); }
// ll comb(ll n, ll k) { ll v=1; for(ll i=1; i<=k; i++) v = DIV(MUL(v, n-i+1),i); return v; }
//

vector<ll> solve(int H,int W,int N,vi& a,vi& b) {
    set<ii> ab;
    rep(i,N) ab.insert( ii(a[i],b[i]) );
    // cerr << "ab:" << ab << endl;

    set<ii> locs;
    rep(i,N){
        for (int dx=-2; dx<=0; ++dx)
        for (int dy=-2; dy<=0; ++dy){
            int x = a[i]+dx, y = b[i]+dy;
            if (IN(x, 0, H-3) && IN(y, 0, W-3)) {
                locs.insert( ii(x,y) ); // 9 x 1e5
            }
        }
    }

    vector<ll> ans(10, 0LL);
    ans[0] = (ll)(H-2)*(W-2) - locs.size();
    for (ii loc : locs) { // 9e5
        // cerr << loc << " : ";
        int cnt = 0;
        rep(i,3) rep(j,3) { // 9
            int x=loc.first+i, y=loc.second+j;
            if (found(ab, ii(x,y))) ++cnt;
        }
        // cerr << cnt << endl;
        ans[cnt]++;
    }
    return ans;
}

int main() {
    int H,W,N; cin >>H>>W>>N;
    vi a(N),b(N);
    rep(i,N) { cin >> a[i] >> b[i]; a[i]--; b[i]--; }
    vector<ll> ans = solve(H,W,N,a,b);
    rep(i,10){
        cout << ans[i] << endl;
    }
    return 0;
}


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

int main() {
	int a,b,c;
	cin >>a>>b>>c;
	if (a<b){
		if(b<c){
			cout<<"Yes"<<endl;
		}
		else{
			cout<<"No"<<endl;
		}
	}
	else{
		cout<<"No"<<endl;
	}
	return 0;
}

Measured memory_bytes: 3076
# -*- coding: utf-8 -*-
import math

N = int(input())

ans = 0
N_half = int(math.sqrt(N))
for A in range(1, N_half+1):
    for B in range(1, N):
        if A * B < N:
            ans += 1
            if B > N_half:
                ans += 1
        else:
            break
    
print(ans)
 

Measured memory_bytes: 9128
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define fr first
#define sc second
#define r_0 return 0
#define TIME ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
    const ll N = 1e5 + 7;
    const ll mod = 1e9 + 7;

int main(){
    TIME
    char c;
    cin >> c;
    ++c;
    cout << c;
}
///...


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

int main() {
	int n;
	cin >> n;
	for (int ni = 0; ni < n; ni++) {
		int a[10], b[11], c[11];
		int pb = 0, pc = 0;
		int ok = 1;
		b[0] = c[0] = 0;
		for (int i = 0; i < 10; i++) {
			cin >> a[i];
			if (a[i] > b[pb]) {
				b[++pb] = a[i];
			}
			else if (a[i] > c[pc]) {
				c[++pc] = a[i];
			}
			else {
				ok = 0;
			}
		}
		if (ok) cout << "YES\n";
		else cout << "NO\n";
	}
}


Measured memory_bytes: 3096
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		System.out.println(eulerPhi(in.nextLong()));
	}

	static long eulerPhi(long n) {
		Map<Long, Integer> m = primeFactorize(n);
		double res = n;
		for (Entry<Long, Integer> e : m.entrySet()) {
			res *= 1.0-1.0/(double)e.getKey();
		}
		return (long)(res+0.001);
	}
	
	static public Map<Long, Integer> primeFactorize(long n) {
		Map<Long, Integer> res = new LinkedHashMap<Long, Integer>();
		long tmp=n;
		for (long i=2;i*i<=n;i++) {
			int count=0;
			while (tmp%i==0) {
				tmp/=i;
				count++;
			}
			if (count!=0) res.put(i, count);
		}
		if (tmp!=1) res.put(tmp, 1);
		if (res.size()==0) res.put(n, 1);
		return res;
	}

}

Measured memory_bytes: 26340
import sys

input = sys.stdin.readline
sys.setrecursionlimit(1000000)


def getN():
    return int(input())


def getList():
    return list(map(int, input().split()))


import math

n = getN()

def judge(i, j):
    if i == j:
        print("ERROR", i)
        sys.exit()
    res = 1
    while(True):
        if i % 2 != j % 2:
            return res
        else:
            res += 1
            i = i>>1
            j = j>>1


for i in range(1, n+1):
    level = []
    for j in range(i+1, n+1):
        level.append(judge(i, j))

    print(*level)

Measured memory_bytes: 48220
<>;++$b[$_]for@a=sort{$a-$b}glob<>;print"@b"=~/^ *\d+\b.*(\b1\b|  )/|$a[0]*2-$a[-1]%2!=$a[-1]|$b[$a[0]]!=1<<$a[-1]%2?Imp:P,ossible

Measured memory_bytes: 768
import java.util.Scanner;

public class Main{
	
	

	public static void main(String[] args) {
		
	Scanner sc=new Scanner(System.in);
	int A=sc.nextInt();
	int P=sc.nextInt();
	int num=A*3+P;
	System.out.println(num/2);

	}
	

	
}
		



Measured memory_bytes: 21844
#include<bits/stdc++.h>                                                                                                   
using namespace std;    
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
                            
#define pb push_back    
#define PII pair<int,int>
                        
#define VS vector<string>
#define VI vector<int>   
#define ll long long int
#define debug(x) cout << x << " :" <<#x << endl  
int main(void) {        
    int a, b;           
    cin >> a >> b;      
    if(a+b >= 10) cout << "error" << endl;
    else cout << a+b << endl;
}  

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

#define ll long long
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long,long long>

#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"

#define Debug(x) cout<<(#x)<<" >> "<<(x)<<endl

using namespace std;

ll fastpow(ll angka,ll pangkat,ll MOD){
	ll res=1;
	while(pangkat){
		if(pangkat&1) res=(res*angka)%MOD;
		angka=(angka*angka)%MOD;
		pangkat=pangkat>>1;
	}
	return res;
}

ll fastpow(ll angka,ll pangkat){
	ll res=1;
	while(pangkat){
		if(pangkat&1) res=(res*angka);
		angka=(angka*angka);
		pangkat=pangkat>>1;
	}
	return res;
}

ll gcd(ll angka1,ll angka2){
	while(angka2){
		swap(angka1,angka2);
		angka2=angka2%angka1;
	}
	return angka1;
}

ll lcm(ll angka1,ll angka2){
	return (angka1/gcd(angka1,angka2))*angka2;
}



void solve(){
	ll n,d;
	cin>>n>>d;
	
	int ct=0;
	for(int i=0;i<n;i++){
		ll a,b;
		cin>>a>>b;
		
		if(sqrt(a*a+b*b)<=d) ct++; 
	}
	cout<<ct<<endl;
	
}

int main(){
	
	fastio();
	
	int t=1;
//	cin>>t;
	
	for(int tt=0;tt<t;tt++){
//		cout<<"Case #"<<tt+1<<": ";solve();
//		if(solve()) cout<<""<<endl;
		solve();
	}
	
	return 0;
}




Measured memory_bytes: 3680
import sys
from collections import defaultdict, Counter, namedtuple, deque
import itertools
import functools
import bisect
import heapq
import math
# from fractions import gcd

MOD = 10 ** 9 + 7
# MOD = 998244353
# sys.setrecursionlimit(10**8)


n = int(input())
num = 0
for i in range(1, n+1):
    last = (n - (n%i))//i
    num += (i * last * (last+1) // 2)

print(num)



Measured memory_bytes: 68144
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<ll>>;
using P = pair<ll, ll>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef vector<ll> vi;
const int MOD = 1000000007;
template<class T> void print(const T& t){ cout << t << 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; }

int main(){
  ll n;
  cin >> n;
  vi w(n);
  rep(i,n){
    cin >> w[i];
  }
  vi t(n,MOD);
  rep(i,n-1){
    ll a = 0;
    ll b = 0;
    rep(j, n){
      if (j <= i){
        a += w[j];
      }
      else{
        b += w[j];
      }
    }
    t[i] = abs(a - b);
  }
  sort(all(t));
  print(t[0]);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
const lint mod = 1e9 + 7;
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcountl((lint)(n))
#define fcout cout << fixed << setprecision(15)
#define highest(x) (63 - __builtin_clzl(x))
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T = string, class U = char>int character_count(T text, U character){ int ans = 0; for(U i: text){ ans += (i == character); } return ans; }
lint power(lint base, lint exponent, lint module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ lint root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position mv[4] = {{0, -1}, {1, 0}, {0, 1}, {-1, 0}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class T, class U> string to_string(pair<T, U> x){ return to_string(x.first) + "," + to_string(x.second); } string to_string(string x){ return x; }
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++) ans += to_string(*i) + " "; if(!ans.empty()) ans.pop_back(); cout << ans << endl; }
template<class itr> void cins(itr first, itr last){ for(auto i = first; i != last; i++){ cin >> (*i); } }
template<class T> T gcd(T a, T b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }} template<class T> T lcm(T a, T b){ return a / gcd(a, b) * b; }
struct combination{ vector<lint> fact, inv; combination(int sz) : fact(sz + 1), inv(sz + 1){ fact[0] = 1; for(int i = 1; i <= sz; i++){ fact[i] = fact[i - 1] * i % mod; } inv[sz] = power(fact[sz], mod - 2, mod); for(int i = sz - 1; i >= 0; i--){ inv[i] = inv[i + 1] * (i + 1) % mod; } } lint C(int p, int q) const{ if(q < 0 || p < q) return 0; return (fact[p] * inv[q] % mod * inv[p - q] % mod); } };
template<class itr> bool next_sequence(itr first, itr last, int max_bound){ itr now = last; while(now != first){ now--; (*now)++; if((*now) == max_bound){ (*now) = 0; }else{ return true; } } return false; }

int main(){
    int N;
    cin >> N;
    int p[N];
    cins(p, p + N);
    int diff = 0;
    for(int i = 0; i < N; i++){
        if(p[i] != i + 1){
            diff++;
        }
    }
    YES(diff <= 2);
}


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

using namespace std;

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

  string ret;
  bool P=false,W=false,G=false,Y=false;

  for(int i=0;i<N;i++)
  {
    if(S[i]=="P")P=true;
    if(S[i]=="W")W=true;
    if(S[i]=="Y")G=true;
    if(S[i]=="G")Y=true;
  }
  int cou=0;
  if(P)cou++;
  if(W)cou++;
  if(G)cou++;
  if(Y)cou++;
  if(cou==3)ret="Three";
  else ret="Four";
  cout<< ret<< endl;

  return 0;
}


Measured memory_bytes: 256
n = int(input())
ab = [tuple(map(int, input().split())) for i in range(n)]
ab.sort(key=lambda ab: ab[1])

t = 0
success = True
for i in range(n):
  t += ab[i][0]
  # print(t)
  dif = ab[i][1] - t
  if dif < 0:
    success = False
    break

print('Yes' if success else 'No')


Measured memory_bytes: 81752
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>

using namespace std;

int main()
{
	int a, b, c;
	cin >> a >> b >> c;
	cout << (a * b * c == 5 * 5 * 7 ? "YES" : "NO") << endl;
	return 0;
}



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

int main(){
	int ans=0;
	string s;
	cin>>s;
	for(int i=0;i<s.size();i++)
		if(s[i]=='+')
			ans++;
		else
			ans--;
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3604
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

int main() {
    string s;
    cin >> s;
    int size = s.size();

    for (int i = 0; i < size; ++i) {
        cout << 'x';
    }
    cout << endl;
    
    return 0;
}

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

int		main(void)
{
	int		a, b, cnt;
	cnt = 0;
	cin >> a >> b;
	vector<vector<bool>> A(a, vector<bool> (b, false));
	cin >> a >> b;
	for (int i = 0; i < a; i++)
	{
		for (auto &&j : A.at(i))
			j = true;
	}
	// printf("--現在の行数は{%d}行目です。--\n", __LINE__);
	for (int i = 0; i < b; i++)
	{
		for (int j = 0; j < A.size(); j++)
			A.at(j).at(i) = true;
	}
	// printf("--現在の行数は{%d}行目です。--\n", __LINE__);
	for (int i = 0; i < A.size(); i++)
	{
		for (auto &&j : A.at(i))
		{
			if (j == false)
				cnt++;
		}
	}
	cout << cnt << endl;
}

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

typedef long long ll;
int N;
vector<int> arr;
vector<ll> X;

int main() {
    scanf("%d", &N);
    arr.resize(N);
    ll sum = 0;
    for(int i = 0; i < N; i++) {
        scanf("%d", &arr[i]);
        sum += arr[i];
    }
    if(sum % (1LL * N * (N + 1) / 2) != 0) {
        printf("NO");
        return 0;
    }
    ll T = sum / (1LL * N * (N + 1) / 2);
    X.resize(N);
    for(int i = 0; i < N; i++) {
        int diff = arr[ (i + 1) % N ] - arr[i];
        if((T - diff) % N != 0 || (T - diff) < 0) {
            printf("NO");
            return 0;
        }
        X[i] = (T - diff) / N;
    }
    printf("YES");
}


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

int main(){
    int dp[101][10001];
    int N,W;
    cin>>N>>W;
    for(int i=0;i<=W;i++){
        dp[0][i] = 0;
    }
    int v,w;
    for(int i=1;i<=N;i++){
        cin>>v>>w;
        for(int j=0;j<=W;j++){
            if(j>=w){
                dp[i][j] = max(dp[i-1][j-w]+v,dp[i-1][j]);
            }else{
                dp[i][j] = dp[i-1][j];
            }
        }
    }
    cout<<dp[N][W]<<endl;
    return 0;
}



Measured memory_bytes: 7032
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define endl "\n"
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
ll mod=1e9+7;

int main() {
                fast
                // #ifndef ONLINE_JUDGE
                // freopen("input.txt","r",stdin);
                // freopen("output.txt","w",stdout);
                // #endif
                ll n,k;
                cin>>n>>k;
                ll ans=n%k;
                ans=min(ans,abs(ans-k));
                cout<<ans;


                return 0;
            }

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define int long long
#define double long double
#define mod 1000000007
#define F first
#define S second
#define P pair<long long,long long>
#define all(a) a.begin(),a.end()
#define INF 1000000000000000000
using namespace std;
int table[510][510],sum[510][510];
signed main(){
    int n,m,q; cin>>n>>m>>q;
    vector<int> a(q),b(q);
    rep(i,m){
        int l,r; cin>>l>>r;
        table[l][r]++;
    }
    rep(i,n){
        int cnt=0;
        rep(j,n){
            cnt+=table[i+1][j+1];
            sum[i+1][j+1]+=cnt+sum[i][j+1];
        }
    }
    rep(i,q){
        cin>>a.at(i)>>b.at(i);
    }
    rep(i,q){
        cout<<sum[b.at(i)][b.at(i)]-sum[a.at(i)-1][b.at(i)]-sum[b.at(i)][a.at(i)-1]+sum[a.at(i)-1][a.at(i)-1]<<endl;
    }
}

Measured memory_bytes: 6528
#include<stdio.h>
#include<string.h>
#include<time.h>
#include<math.h>
int main(void)
{
     int a,b,c;
     scanf("%d",&a);
     scanf("%d",&b);
     if((a==1&&b==2)||(a==2&&b==1)){
        c=3;
     }else if((a==1&&b==3)||(b==1&&a==3)){
        c=2;
     }else if((a==2&&b==3)||(b==2&&a==3)){
        c=1;
     }
     printf("%d",c);
     return 0;
}

Measured memory_bytes: 128
import java.io.IOException;
import java.util.Scanner;

public class Main {

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

		new Main().run();
	}

	private void run() throws IOException {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			int n = scanner.nextInt();
			int m = scanner.nextInt();
			if ((n | m) == 0)
				break;
			int[] map = new int[n];
			for (int i = 0; i < n; i++)
				map[i] = scanner.nextInt();
			int[] a = new int[m];
			for (int i = 0; i < m; i++)
				a[i] = scanner.nextInt();
			int x = 0;
			for (int i = 0; i < m; i++) {
				x += a[i];
				if (x >= n - 1) {
					System.out.println(i + 1);
					break;
				}
				x += map[x];
				if (x >= n - 1) {
					System.out.println(i + 1);
					break;
				}
			}

		}
	}
}

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

int main() {
    int n,sum = 0;
    cin >> n;
    vector<string> s(n);
    for(int i = 0; i < n; i++){
        cin >> s.at(i);
    }
    int m;
    cin >> m;
    vector<string> t(m);
    for(int i = 0; i < m; i++){
        cin >> t.at(i);
    }

    for(int i = 0; i < n; i++){
        int buf = 0;
        for(int j = 0; j < n; j++){
            if(s.at(j) == s.at(i)){
                buf++;
            }
        }
        for(int j = 0; j < m; j++){
            if(t.at(j) == s.at(i)){
                buf--;
            }
        }
        if(buf > sum){
            sum = buf;
        }
    }
    cout << sum << endl;
}


Measured memory_bytes: 256
//====== begin of bisma c++ template===========
#include<bits/stdc++.h>
#include <assert.h>
using namespace std;
#define rep(a,b,c) for(int a=b;a<=c;a++)
#define ll long long 
#define sum(a,b) a=a+b
#define mem(a, b) memset(a, (b), sizeof(a))


//=======binarysearch===========
int bs(vector<long long>&a,int que){
 auto it=lower_bound(a.begin(),a.end(),que);
 if(*it==que){
    return it-a.begin();
 }
 return -1;
}
//========binarysearch=========



//=======SUBSET WITH BRUTEFORCE=============
void subsets(int S[], int n) {
     int nSub = 1<<n; 
     for(int i=0; i<nSub; i++){
     	  cout<<"{ ";//optional
          for(int k=0; k<n; k++){
               //if the k-th bit is set
               if( (1<<k) & i){
                    cout<<S[k]<<" ";
               } 
          }
          cout<<"}\n"; //optional
     }
}
//======SUBSET WITH BRUTE FORCE================


//======permuatate all ==================
void permutate(){
int n,x;
cin>>n;

vector<int> permutation;
for (int i = 0; i < n; i++) {
	cin>>x;
permutation.push_back(x);
}
do {
 rep(i,0,n-1) cout<<permutation[i];
 cout<<endl;
} while (next_permutation(permutation.begin(),permutation.end()));

}
//====permuatate all======================


//====check prime =========================

bool prime(ll x){
	ll ans=0;

	if(x==1){
		return false;
	}

	for(ll i=2;i<=sqrt(x);i++){
		if(x % i == 0){
			return false;
		}
	}

	return true;
}
//===check prime ========================


//======= the end of bisma c++ template ============




int main(){


int d,n;
cin>>d>>n;

int s=1;
rep(i,1,d) s=s*100;

if(n>99){
	cout<<101*s;
}else{
	cout<<s*n;	
}

return 0;
}


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

int main() {
    int n;
    cin >> n;
    map<int, uint64_t> a_count;
    vector<int> a_s(n);
    for(int i = 0; i < n; ++i) {
        int a;
        cin >> a;
        a_s[i] = a;
        a_count[a]++;
    }
    uint64_t sum = 0;
    for(map<int, uint64_t>::iterator it = a_count.begin(); it != a_count.end(); ++it) {
        int c = it->second;
        sum += ((c>1)?(uint64_t)c*(c-1)/2:0);
    }
    for(vector<int>::iterator it = a_s.begin(); it != a_s.end(); ++it) {
        cout << ((sum>0) ? sum - (a_count[*it]-1) : 0) << endl;
    }
    return 0;
}

Measured memory_bytes: 11008
#include <stdio.h>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>
#include <tuple>

// #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back

int ctoi(char c) {
	switch (c) {
		case '0': return 0;
		case '1': return 1;
		case '2': return 2;
		case '3': return 3;
		case '4': return 4;
		case '5': return 5;
		case '6': return 6;
		case '7': return 7;
		case '8': return 8;
		case '9': return 9;
		default: return 0;
	}
}

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

  int nearNum = -247;
  for(int i=0 ; i<s.size()-2; i++){
    int num = ctoi(s.at(i)) * 100 + ctoi(s.at(i+1) )* 10 + ctoi(s.at(i+2));
    //cout << num <<" " << ctoi(s.at(i))å << endl;
    if(abs(753-nearNum) > abs(753-num)){
        nearNum = num;
    }
  }
  
  cout << abs(753-nearNum) << endl;

}


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

int main() {
  long s, flag = 0, ans = 0;
  cin >> s;
  long tmp = s;
  vector<int> item(1000000);
  item.at(0) = tmp;
  
  for (int i = 1; i < 1000000; i++) {
    if (tmp%2 == 0) tmp = tmp / 2;
    else tmp = 3 * tmp + 1;
    item.at(i) = tmp;
    for (int j = 0; j < i; j++) {
      if (item.at(j) == tmp) {
        ans = i + 1;
        flag = 1;
        break;
      }
    }
    if (flag == 1) break;
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 7196
// AtCoder Regular Contest 088
// C - Multiple Gift

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;

ll X, Y;

int main() {
    ll a;
    int ans;

    cin >> X >> Y;
    a = X;
    for (ans = 1; a * 2 <= Y; ans++) {
        a *= 2;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <limits>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, a, n) for (int i = a; i < n; i++)
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eps 1e-15

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef tuple<int, int, int> ti3;

int main()
{
    int m, d;
    scanf("%d %d", &m, &d);

    printf("%d\n", m + (m <= d ? 1 : 0) - 1);
}


Measured memory_bytes: 256
#include <iostream>
#include <cassert>
#include <vector>
#include <set>
#include <queue>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <complex>
#include <cmath>

using namespace std;
typedef long long ll;

typedef double R;
typedef complex<R> P;

const R EPS = 1e-10;
const R INF = 1e9;
const R PI = acos((R)(-1));

//?§???????[0, 2*PI)???
R radNorP(R x) {
    return fmod(fmod(x, 2*PI) + 2*PI, 2*PI);
}

//?§???????[-PI, PI)???
R radNorN(R x) {
    x = radNorP(x);
    if (x >= PI) x -= 2*PI;
    return x;
}

R deg2rad(R x) {
    return x/180*PI;
}

int n;
R r, th;
P p[22];

R dp[22][22][10100];
R g[22][22][22];
int main() {
    cin >> n;
    cin >> r >> th; th = deg2rad(th);
    for (int i = 0; i < n; i++) {
        R x, y;
        cin >> x >> y;
        p[i] = P(x, y);
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            for (int k = 0; k < n; k++) {
                g[i][j][k] = INF;
                if (i == j || j == k) continue;
                R u = arg(p[j]-p[i]) - arg(p[k] - p[j]);
                u = abs(radNorN(u));
                if (u >= th) continue;
                g[i][j][k] = abs(p[k] - p[j]);
//                printf("%d %d %d %Lf %Lf\n", i, j, k, u, g[i][j][k]);
            }
        }
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            dp[i][j][1] = INF;
            if (i != 0) continue;
            if (j == 0) continue;
            dp[0][j][1] = abs(p[j] - p[i]);
        }
    }
    for (int s = 2; s < 10100; s++) {
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                dp[i][j][s] = INF;
                for (int k = 0; k < n; k++) {
                    dp[i][j][s] = min(dp[i][j][s],
                        dp[k][i][s-1] + g[k][i][j]);
                }
            }
        }
    }
    int res = 0;
    for (int s = 1; s < 10100; s++) {
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (dp[i][j][s] < r) res = max(res, s);
            }
        }
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 35980
#include <bits/stdc++.h>
#define INF (1<<30)
#define MOD 1000000007
#define l_ength size
using ll = long long;
using namespace std;

int main(){
	int n; cin >> n;
	vector<int> a(n);
	for( auto &k : a ) cin >> k;
	int g = set<int>( a.begin(), a.end() ).size();
	bool flag;
	if( g == 1 ){
		flag = ( n >= 2*a[0] || a[0] == n-1 ) ? true : false;	
	} else if ( g >= 3 ){
		flag = false;
	} else {
		sort( a.begin(), a.end() );
		int x = a.front(), y = a.back();
		if( y-x != 1 ) flag = false;
		else {
			int s = upper_bound( a.begin(), a.end(), y ) - lower_bound( a.begin(), a.end(), y);
			flag = ( n-s < y && (y-(n-s))*2 <= s ) ? true : false;
		}
	}
	cout << ( flag ? "Yes" : "No" ) << endl;
	return 0;
}

Measured memory_bytes: 5376
N, A, B, C = map(int, input().split())
d = {}
d["A"] = A
d["B"] = B
d["C"] = C
l = [input() for _ in range(N)]
v = A+B+C

def solve():
    res = []
    if v==0:
        return []
    elif v==1:
        for i in l:
            a, b = i
            if d[a]==0 and d[b]==0:
                return []
            elif d[a]>d[b]:
                d[a] -= 1
                d[b] += 1
                res.append(b)
            else:
                d[a] += 1
                d[b] -= 1
                res.append(a)
    else:
        a, b = l[0]
        if d[a]==0 and d[b]==0:
            return []
        else:
            for i, j in enumerate(l):
                a, b = j
                if d[a]>d[b]:
                    d[a] -= 1
                    d[b] += 1
                    res.append(b)
                elif d[a]==d[b]==1 and i+1<N:
                    e = set(l[i+1])&set([a, b])
                    if len(e)==1:
                        f = e.pop()
                        g = b if f==a else a
                        d[f] += 1
                        d[g] -= 1
                        res.append(f)
                    else:
                        d[a] -= 1
                        d[b] += 1
                        res.append(b)
                else:
                    d[a] += 1
                    d[b] -= 1
                    res.append(a)
    return res


r = solve()
if r:
    print("Yes")
    for i in r:
        print(i)
else:
    print("No")


Measured memory_bytes: 17040
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <cassert>
#include <functional>
#include <string>
using namespace std;


int main(){
  int n; cin >> n;
  if(n/100 == n%10) cout << "Yes" << endl;
  else cout << "No" << endl;
  
}


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

int main() {

    int N;
    cin >> N; 
	vector<int> V(N);
	vector<int> C(N);
	for(int i=0;i<N;i++){
		cin >> V.at(i);
	}
	for(int i=0;i<N;i++){
		cin >> C.at(i);
	}
	int max_number = 0;
	for(int i=0;i<N;i++){
		max_number += max(0, V.at(i) - C.at(i));
	}
	cout << max_number;
	return 0;
}

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

int main()
{
    int n, k , q;
    cin>>n>>k>>q;

    vector <int> arr(n, k-q);
    for(int i = 0; i < q ; i++)
    {
        int a;

        cin>>a;
        --a;
        arr[a]++;
    }
    for(int i = 0; i < n ; i++)
    {
        if(arr[i]<= 0) cout<<"No"<<endl;
        else cout<<"Yes"<<endl;
    }
}


Measured memory_bytes: 1024
A = []
H, W = map(int, input().split())
while H != 0 or W != 0:
    A.append([H,W])
    H, W = map(int, input().split())
for i in range(len(A)):
    print('#' * A[i][1])
    for j in range(1, A[i][0]-1):
        print('#' + '.' * (A[i][1]-2) + '#')
    print('#' * A[i][1])
    print('')


Measured memory_bytes: 5624
#include<bits/stdc++.h>
using namespace std;
int n;
string s;
void dfs(int i, char u)
{
    if (i == n) {
        cout << s << '\n';
        return;
    }
    for (char c = 'a'; c <= u; ++c) {
        s[i] = c;
        dfs(i + 1, u);
    }
    if (i > 0) {
        s[i] = u + 1;
        dfs(i + 1, u + 1);
    }
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> n;
    s.resize(n);
    dfs(0, 'a');
}


Measured memory_bytes: 1536
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define rep(i,n) for(int (i) = 0; (i) < (n); ++(i))
#define repp(i,n) for(int (i) = 1; (i) <= (n); ++(i))
#define popcnt __builtin_popcount
#define all(v) v.begin(),v.end()
#define _Pi 3.1415926535
#define _MOD = 1e9+7;
using namespace std;
using ll = long long;
using pint = pair<int,int>;
using itn = int;
using vint = vector<int>;
template<class T> inline bool chmax(T& a, T b){if(a<b){a = b; return true;} return false;}
template<class T> inline bool chmin(T& a, T b){if(a>b){a = b; return true;} return false;}
template<class T> T gcd(T a, T b){return b?GCD(b,a%b):a;}
template<class T> T lcm(T a, T b){return a*b/GCD(a,b);}

int main(){
    int n; cin >> n;
    vint p(n); rep(i,n) cin >> p[i];

    cout << accumulate(all(p),0) - *max_element(all(p))/2 << endl;

    return 0;
}


Measured memory_bytes: 256
s = list(input())
t = list(input())
ls, lt = len(s), len(t)
sa, sb = [0] * (ls + 1), [0] * (ls + 1)
ta, tb = [0] * (lt + 1), [0] * (lt + 1)
for i in range(1, ls + 1):
    if s[i - 1] == "A":
        sa[i] = sa[i - 1] + 1
        sb[i] = sb[i - 1]
    else:
        sa[i] = sa[i - 1]
        sb[i] = sb[i - 1] + 1
for i in range(1, lt + 1):
    if t[i - 1] == "A":
        ta[i] = ta[i - 1] + 1
        tb[i] = tb[i - 1]
    else:
        ta[i] = ta[i - 1]
        tb[i] = tb[i - 1] + 1

q = int(input())
for _ in range(q):
    ans = 0
    a, b, c, d = map(int, input().split())
    a1, b1 = sa[b] - sa[a - 1], sb[b] - sb[a - 1]
    a2, b2 = ta[d] - ta[c - 1], tb[d] - tb[c - 1]
    x, y = a1 - b1, a2 - b2
    if x * y < 0:
        x = -2 * x
    if abs(x - y) % 3 == 0:
        ans = 1
    print("YES" if ans == 1 else "NO")

Measured memory_bytes: 20160
//khodaya khodet komak kon
#include <bits/stdc++.h>

#define F first
#define S second
#define pb push_back
#define all(x) x.begin(), x.end()
#pragma GCC optimize ("Ofast")
#pragma GCC optimize("unroll-loops")
#define int long long

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

const int N = 100000 + 10;
const ll MOD = 1000000000 + 7;
const ll INF = 1000000010;
const ll LOG = 25;

int n, m, mark[N], COM[N], q;
vector<pii> E;
vi G[N];
vi g[N];

void DFS(int v, int c){
	COM[v] = c;
	mark[v] = 1;
	for (int u:G[v]){
		if (mark[u] == 0) DFS(u, c);
	}
}

int32_t main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> m >> q;
	for (int i = 1; i <= q; i++){
		int v, u, c;
		cin >> v >> u >> c;
		v++, u++;
		if (c == 0) G[v].pb(u), G[u].pb(v);
		else E.pb({v, u});
	}
	int com = 0;
	for (int i = 1; i <= n; i++){
		if (!mark[i]){
			DFS(i, ++com);
//			cout << i << '\n';
		}
	}
//	cout << com << '\n';
	for (auto u:E){
		if (COM[u.F] == COM[u.S]) return cout << "No", 0;
	}
	int Now = n - com;
	if (Now > m) return cout << -1, 0;
	if (Now + com * (com - 1) / 2 < m) return cout << "No", 0;
	bool f = 0;
	if (E.size() != 0) f = 1;
	if (f && com < 3) return cout << "No", 0;
	if (f == 0){
		Now += com - 1;
		return cout << (Now <= m?"Yes":"No"), 0;
	}
	Now += com;
	return cout << (Now <= m?"Yes":"No"), 0;
	






	return 0;
}


Measured memory_bytes: 10880
#include <cstdio>
#include <cstdint>
#include <cinttypes>
#include <iostream>
#include <vector>
#include <utility>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <string>
#include <limits>
using namespace std;
using u8t = std::uint64_t;
using i8t = std::int64_t;
using vi8t = std::vector<i8t>;
using vvi8t = std::vector<std::vector<i8t>>;
using vu8t = std::vector<u8t>;
static const i8t i8t_max=numeric_limits<i8t>::max();
static const i8t i8t_min=numeric_limits<i8t>::min();
#define F(I,N) for(i8t I=0,I##_N=N;I<I##_N;I++)
#define FR(I,N) for(i8t I=N;I--;)
#define R(V) i8t V;std::cin>>V;
#define RV(V,N) std::vector<i8t> V;F(_i,N){R(_x)V.push_back(_x);}
#define RL1(line) std::getline(std::cin,line);
#define RL(line) std::string line;RL1(line)
#define RM(V,L,C) std::vector<char> V;F(_i,L){RL(_l)F(_j,C)V.push_back(_l[_j]);}
#define P(X) std::cout<<(X)<<std::endl;

template<typename T>
void print_range(T arr){
  for(auto x:arr)std::cout<<" "<<x;
  std::cout<<std::endl;
}

i8t case_even(i8t const N,std::vector<i8t>const& accum){
  i8t ans=0;
  for(int x=0;x<N;x+=2){
    i8t a1=x-1>=0?accum[x-1]:0;
    i8t a2=x-2>=0?accum[x-2]:0;
    i8t c1=a2-a1;
    ans=max(ans,c1);
  }
  ans+=accum[N-1];
  return ans;
}

void main1() {
  R(N)RV(A,N);

  // N 奇数
  std::vector<i8t> accum(N+1,0);//accum[N] はダミー
  F(I,N){
    if(I==0)accum[0]=A[0];
    else if(I==1)accum[1]=A[1];
    else accum[I]=accum[I-2]+A[I];
  }

  if(N%2==0){
    i8t ans=case_even(N, accum);
    ans=max(ans,accum[N-2]);
    P(ans);
  }else{
    std::vector<i8t> gain(N+1,0);//gain[N]=dummy for x=N-1,
    F(x,N){
      i8t a1=x-1>=0?accum[x-1]:0;
      i8t a2=x-2>=0?accum[x-2]:0;
      i8t c1=a2-a1;
      gain[x]=c1;
    }

    // これで奇数番目は全てそれ以降の物の最大値に置き換える。
    i8t mx=gain[N-2];
    for(i8t i=N-2;i>=0;i-=2){
      gain[i]=mx=std::max(mx,gain[i]);
    }

    //print_range(gain);

    i8t ans=gain[0]+gain[1];
    for(i8t i=0;i<N-2;i+=2){
      ans=max(ans,gain[i]+gain[i+1]);
    }
    ans+=accum[N-1];
    ans=max(case_even(N-1,accum),ans);
    ans=max(ans,accum[N-3]);
    P(ans);
  }
}

template<typename T>
T umax(T& ans,T const& value) {if(value>ans)ans=value;return ans;}
template<typename T>
T umin(T& ans,T const& value) {if(value<ans)ans=value;return ans;}

void main2(){
  R(N)RV(A,N);

  vvi8t ac(3, vi8t(N, i8t_min));
  auto _ac=[&](i8t k,i8t i){
    if(i<0)return k==0&&i==-2?0:i8t_min;
    return ac[k][i];
  };

  F(K,3)F(I,N){
    i8t a=_ac(K,I-2);
    for(int k=1;k<=K;k++)
      umax(a,_ac(K-k,I-2-k));
    if(a!=i8t_min)a+=A[I];
    ac[K][I]=a;
  }

  if(N%2==0){
    i8t ans=ac[0][N-2];
    umax(ans,ac[1][N-1]);
    P(ans);
  }else{
    i8t ans=ac[0][N-3];
    umax(ans,ac[1][N-2]);
    umax(ans,ac[2][N-1]);
    P(ans);
  }
}

int main(){
  //main1();
  main2();
  return 0;
}


Measured memory_bytes: 11120