akhauriyash/Code-Regression huggingface dataset:
import math

a, b = [int(input()) for i in range(2)]
if (a == 1 and b == 2) or (a == 2 and b == 1):
    print(3)
elif (a == 2 and b == 3) or (a == 3 and b == 2):
    print(1)
else:
    print(2)


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

using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define rep1(i,n) for(int i = 1; i <= (n); i++)
#define all(v) v.begin(),v.end()
#define ve vector
#define vi vector<int>
#define vi2 vector<vi>
#define vl vector<long long>
#define vl2 vector<vl>

template <class T> T maxAny(T a, T b){
    if(a > b) return a;
    else return b;
}

template <class T> T minAny(T a, T b){
    if(a > b) return b;
    else return a;
}

int main(){
    int k;
    cin >> k;
    rep(i, k) cout << "ACL";
    cout << endl;
}

Measured memory_bytes: 3652
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <math.h>
using namespace std;

using QWORD = unsigned long long;
using SQWORD = long long;
using DWORD = unsigned int;
using SDWORD = int;
using WORD = unsigned short;
using SWORD = short;
using DOUBLE = double;
using FLOAT = float;

#define MIN_SDWORD (-2147483648)
#define MAX_SDWORD (2147483647)
#define ArrayLength(a)  (sizeof(a) / sizeof(a[0]))

static inline QWORD MAX(QWORD a, QWORD b) { return a > b ? a : b; }
static inline DWORD MAX(DWORD a, DWORD b) { return a > b ? a : b; }
static inline SDWORD MAX(SDWORD a, SDWORD b) { return a > b ? a : b; }
static inline QWORD MIN(QWORD a, QWORD b) { return a < b ? a : b; }
static inline DWORD MIN(DWORD a, DWORD b) { return a < b ? a : b; }
static inline SDWORD MIN(SDWORD a, SDWORD b) { return a < b ? a : b; }

#define BYTE_BITS   (8)
#define WORD_BITS   (16)
#define DWORD_BITS  (32)
#define QWORD_BITS  (64)

using M_BOOL = bool;
#define M_TRUE (true)
#define M_FALSE (false)

static void printMatrix(DWORD **p, DWORD dwSize)
{
    printf("---\n");
    for (DWORD i = 0; i < dwSize; i++) {
        for(DWORD j = 0; j < dwSize; j++) {
            printf("%5d", p[i*dwSize + j]);
        }
        cout << endl;
    }
    printf("---\n");
}

int main()
{
    DWORD dwInput_N, dwInput_M, dwInput_Q;
    char str[6000];

    cin.getline(str, sizeof(str));
    dwInput_N = atoi(strtok(str, " "));
    dwInput_M = atoi(strtok(NULL, " "));
    dwInput_Q = atoi(strtok(NULL, " "));

    /* input train */
    static DWORD aadwTrainMap[501][501];
    for (DWORD dwIdx = 0; dwIdx < dwInput_M; dwIdx++) {
        cin.getline(str, sizeof(str));
        WORD wCity_L, wCity_R;

        wCity_L = atoi(strtok(str, " "));
        wCity_R = atoi(strtok(NULL, " "));
        aadwTrainMap[wCity_L][wCity_R]++;
    }

    /* calc camsum(Row) */
    for (DWORD dwRow = 0; dwRow <= dwInput_N; dwRow++) {
        DWORD dwSum = 0;
        for (DWORD dwCol = dwRow; dwCol <= dwInput_N; dwCol++) {
            dwSum += aadwTrainMap[dwRow][dwCol];
            aadwTrainMap[dwRow][dwCol] = dwSum;
        }
    }

    /* calc camsum(col) */
    for (DWORD dwCol = 0; dwCol <= dwInput_N; dwCol++) {
        DWORD dwSum = 0;
        for (DWORD dwRow = 0; dwRow <= dwInput_N; dwRow++) {
            dwSum += aadwTrainMap[dwRow][dwCol];
            aadwTrainMap[dwRow][dwCol] = dwSum;
        }
    }

    /* input question */
    for (DWORD dwIdx = 0; dwIdx < dwInput_Q; dwIdx++) {
        DWORD dwAnswer;
        cin.getline(str, sizeof(str));
        WORD wBegin = atoi(strtok(str, " "));
        WORD wEnd   = atoi(strtok(NULL, " "));

        dwAnswer= (aadwTrainMap[wEnd][wEnd]
                    - aadwTrainMap[wBegin-1][wEnd]
                    - aadwTrainMap[wEnd][wBegin-1]
                    + aadwTrainMap[wBegin-1][wBegin-1]);
        printf("%d\n", dwAnswer);
    }

    return 0;

}


Measured memory_bytes: 1920
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n, m = map(int, input().split())
graph = [-1] + [[] for _ in range(n)]
for _ in range(m):
    n1, n2 = map(int, input().split())
    graph[n1].append(n2)
    graph[n2].append(n1)

from collections import deque

def bfs(graph, queue, dist, prev):
    while queue:
        current = queue.popleft()

        for c in graph[current]:
            if dist[c] != -1:
                continue
            dist[c] = dist[current] + 1
            prev[c] = current
            queue.append(c)

queue = deque([1])
dist = [0] + [-1] * n
prev = [0] + [-1] * n
dist[1] = 0
prev[1] = 0
bfs(graph, queue, dist, prev)
if -1 in prev:
    print('No')
else:
    print('Yes')
    for p in prev[2:]:
        print(p)


Measured memory_bytes: 93056
#include <cmath>
#include <ctime>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <bitset>
#include <functional>
#include <numeric>
#include <utility>
#include <iomanip>
#include <cstdio>
#include <cctype>
#include <queue>
#include <complex>
#include <climits>

typedef long long ll;

using namespace std;

int main(void){
	int a, b;
	while(1){
		if(cin >> a == 0) break;
		cin >> b;

		if(a==0 && b==0){
			cout << "1" << endl;
			continue;
		}

		int count = 0;
		int c = a + b;
		while(c != 0){
			c /= 10;
			count++;
		}

	cout << count << endl;

	}

	return 0;
}

Measured memory_bytes: 1156
//C
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<functional>
using namespace std;
int main(){
	int n,m;
	while(true){
	cin>>n>>m;
	if(n==0&&m==0)break;
	vector<pair<int,int> >t(0);//危険度、距離
	t.resize(11001);
	for(int i=0;i<n;i++){
	int a,b;
	cin>>a>>b;//距離、北市
	t[i]=(make_pair(b,a));
	}
	sort(t.begin(),t.end(),greater<pair<int,int> >());
	int iii=0;
	while(m>0){
	bool f=0;
	for(int j=0;j<n;j++)if(t[j].second!=0)f=1;
	if(f==0)break;
	//cout<<"a";
	if(m>=t[iii].second){
	m-=t[iii].second;
	t[iii].second=0;
	}
	else {
	t[iii].second-=m;
	m=0;
	}
	iii++;
	}
	int  ans=0;
	for(int i=0;i<n;i++){
	ans+=t[i].first*t[i].second;
	}
	cout<<ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 1284
//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>

#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define bit(n,k) (((ll)n>>(ll)k)&1) /*nのk bit目*/
#define pb push_back
#define eb emplace_back
#define SZ(x) ((ll)(x).size())
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const long long INF= 1e+18+1;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007LL;
//ll MOD=1000000007LL;
//const ll MOD=998244353LL;
//const ll MOD=1777777777LL;
//const ll MAX_V=114514LL;
//const ll MAX = 500010LL;
const ll mod=MOD;
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
vl dx={0,0,1,-1};
vl dy={1,-1,0,0};

//素因数分解O(√n)
map<ll,ll>prime_factor(ll n){
  map<ll,ll>res;
  for(ll i=2;i*i<=n;i++){
    while(n%i==0){
      res[i]++;
      n/=i;
    }
  }
  if(n!=1)res[n]=1;
  return res;
}

const ll MAX = 510000;
long long fac[MAX], finv[MAX], inv[MAX];
//finvが階乗の逆元

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll modpow(ll a, ll n, ll mod) {
  
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}



int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  cout << fixed << setprecision(10);
  /*--------------------------------*/
  ll n;cin>>n;
  ll k;cin>>k;
  vl a(n);
  rep(i,n)cin>>a[i];
  for(ll i=0;i+k<n;i++){
    if(a[i+k]>a[i])cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
}

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

int main() {

  int N;
  cin >> N;

  long long  A[N], subord[N];

  for(int i=0; i<N-1; i++){
    cin >>A[i];
    subord[i]=0;
  }

  for(int j=0; j<N - 1; j++){
    subord[A[j] -1]++;
  }
  for(int n=0; n<N -1; n++){
    cout << subord[n] << endl;
  }
  cout << 0 << endl;
}

Measured memory_bytes: 6760
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n,k;
    string s;
    cin>>n>>k;
    cin>>s;
    int ans=0;
    int mukai=0;
    int gyaku=0;
    int onaji=0;
    for(int i=0;i<n;++i){
        if(s[i]=='L'){
            if(i-1>=0){
                if(s[i-1]=='L'){
                    onaji+=1;
                }
            }
        }
        else{
            if(i+1<n){
                if(s[i+1]=='R'){
                    onaji+=1;
                }
            }
        }
    }
    for(int i=0;i<n-1;++i){
        if(s[i]=='R'&&s[i+1]=='L'){mukai+=1;}
        if(s[i]=='L'&&s[i+1]=='R'){gyaku+=1;}
    }
    int shori=0;
    int m=min(mukai,gyaku);
    if(k>=m){if(k>m||k==m&&mukai==gyaku){cout<<n-1<<endl;return 0;}
        else{cout<<n-2<<endl;return 0;}
    }
    else{ans=onaji+k*2;}
    cout<<ans<<endl;
}


Measured memory_bytes: 512
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

N =ni()
A=na()
ma = max(A)
ma_in = A.index(ma)
mi = min(A)
mi_in = A.index(mi)
P=[]
if(ma==mi):
    pass
elif(ma<=0):
    for i in reversed(range(1,N)):
        P.append([i+1,i])
elif(mi>=0):
    for i in range(1,N):
        P.append([i,i+1])
else:
    if(abs(ma)>=abs(mi)):
        for i in range(N):
            if(A[i]<0):
                A[i]+=ma
                P.append([ma_in+1,i+1])
        for i in range(1,N):
            P.append([i,i+1])
            #A[i+1]+=A[i]
    elif(abs(ma)<=abs(mi)):
        for i in range(N):
            if(A[i]>0):
                A[i]+=mi
                P.append([mi_in+1,i+1])
        for i in reversed(range(1,N)):
            P.append([i+1,i])
print(len(P))
for p in P:
    print(p[0],p[1])

Measured memory_bytes: 3064
#include<iostream>
    using namespace std;
    int main(){
        int N, count=0;
        int A[200];
        cin >> N;
        for(int i=0;i<N;i++) cin >> A[i];
        bool exist_odd = false;
        for(int k=0;;k++){
            for(int i=0;i<N;i++){
                if(A[i]%2 != 0) exist_odd = true;
                A[i] /= 2;
            }
            if(exist_odd) break;

            ++count;
        }
        cout << count <<endl;
        
    }


Measured memory_bytes: 256
import java.util.Scanner;
import java.util.*;
public class Main {
    static long[] sum;
    static long[] p;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long x = sc.nextLong();
        sum = new long[n];
        p = new long[n];
        sum[0] = 1;
        p[0] = 1;
        for (int i = 1; i < n; i++) {
            sum[i] = 2 * sum[i - 1] + 3;
            p[i] = 2 * p[i - 1] + 1;
        }
        long ans = f(n, x);
        System.out.println(ans);
    }
    public static long f(int n, long x) {
        if (n == 0 && x == 0) {
            return 0;
        }
        if (n == 0 && x != 0) {
            return 1;
        }
        if (x <= 1) {
            return 0;
        } else if (x <= 1 + sum[n - 1]) {
            return f(n - 1, x - 1);
        } else if (x <= 2 + 2 * sum[n - 1]) {
            return p[n - 1] + 1 + f(n - 1, x - 2 - sum[n - 1]);
        } else {
            return 2 * p[n - 1] + 1;
        }
    }
}


Measured memory_bytes: 23636
#include <bits/stdc++.h>
using namespace std;
 
 
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
 
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
 
#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define fill(a)  memset(a, 0, sizeof (a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

void pre(){


}
 
void solve(){
 
 
}

int main() {
	cin.sync_with_stdio(0); cin.tie(0);
	cin.exceptions(cin.failbit);
	pre();

    ld r;cin>>r;
    cout<<setprecision(12);
    cout<<2*r*3.14159265359;

	return 0;
}
 



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

import math

a, b = map(str, input().split())

c = int(a + b)

flag = False

for i in range(1, 1000):
    if (i**2 == c):
        flag = True
        print("Yes")
        break
    elif (i**2 > c):
        break
if not flag:
    print("No")

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    int p[200100];
    cin >> n;
    for(int i = 0; i < n; i++) cin >> p[i];
    int count = 0; 
    int minimum = 1001001001;
    for(int i = 0; i < n; i++){
        minimum= min(minimum, p[i]);
        if(minimum == p[i]) count++;
    }
    cout << count << endl;
}

Measured memory_bytes: 4416
#include <iostream>
#include <vector>
 
using namespace std;
 
int main(){
    int n, m, ans;
    cin >> n;
    cin >> m;
    int vector1[n][m];
    int vector2[m];
 
    for ( int i = 0; i < n; i++ ) {
        for ( int j = 0; j < m; j++ ) {
            cin >> vector1[i][j];
        }
    }
 
    for ( int i = 0; i < m; i++ ) {
        cin >> vector2[i];
    }
 
    for (int i = 0; i < n; i++) {
        ans = 0;
        for (int j = 0; j < m; j++) {
            ans += vector1[i][j] * vector2[j];
        }
        cout << ans << endl;
    }
 
    return 0;
}


Measured memory_bytes: 3124
// Author: Vamsi Krishna Reddy Satti
// With love for Competitive Programming!
 
#include <bits/stdc++.h>
using namespace std;
 
#define fast_io ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define cout_precision cout.setf(ios::fixed); cout.precision(32);
 
using ll = int64_t; using vll = vector<ll>; using vvll = vector<vll>;
using pll = pair<ll, ll>; using vpll = vector<pll>; using vvpll = vector<vpll>;
using ld = long double;
 
// ------------------------------------------------------------------------------------------------

ll n, k, ans;
unordered_set<ll> s;

ll valid(ll num) {
    for (; num > 0; num /= 10) {
        if (s.find(num % 10) != s.end()) {
            return 0;
        }
    }
    return 1;
}

int main() {
    fast_io; cout_precision;
    cin >> n >> k;
    for (ll i = 0, d; i < k; i++) {
        cin >> d;
        s.insert(d);
    }
    for (ans = n; !valid(ans); ans++);
    cout << ans << endl;
}

Measured memory_bytes: 256
//#pragma GCC optimize ("-O3","unroll-loops")
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>


#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define m0(x) memset(x,0,sizeof(x))
#define print(x) cout<<x<<'\n';
#define pe(x) cout<<x<<" ";
#define lb(v,n) lower_bound(v.begin(), v.end(), n);
#define ub(v,n) upper_bound(v.begin(), v.end(), n);
//#define int long long
#define all(x) (x).begin(), (x).end()
//#define double long double

using namespace std;

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

const int MOD = 1e9 + 7;
const ll INF = 1e17;
const int INT_INF = 1e9;
const double pi = acos(-1);
const double EPS = 1e-10;
typedef pair<int, int>P;
const int MAX = 200020;




signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	string S; cin >> S;
	if (S == "Sunny") {
		print("Cloudy");
	}
	else if (S == "Cloudy")print("Rainy")
	else print("Sunny");
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<char> vc;
typedef queue<ll> ql;
typedef deque<ll> dql;
typedef priority_queue<ll/*, vl, greater<ll>*/> pql; //降順(/*昇順*/)
typedef set<ll> sl;
typedef pair<ll, ll> pl;
typedef vector<vl> vvl;
typedef vector<pl> vpl;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define rep2(i, n) for(ll i = 1; i <= ll(n); i++)
//#define rep(i, k, n) for(ll i = k-1; i < ll(n); i++)
//#define rep2(i, k, n) for(ll i = k; i <= ll(n); i++)
#define all(v) (v).begin(), (v).end()
bool chmin(ll &a, ll b) {if(b < a) {a = b; return 1;} return 0;}
bool chmax(ll &a, ll b) {if(b > a) {a = b; return 1;} return 0;}
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
const ll MAX = 1e9;
const char newl = '\n';

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

  ll n, x=0, y=0, ans=0;
  cin >> n;
  vl a(n);
  rep(i, n) {
    cin >> a[i];
    if(i==0) x+=a[i];
    else y+=a[i];
  }
  ans = abs(x-y);
  
  rep2(i, n-2) {
    x += a[i];
    y -= a[i];
    chmin(ans, abs(x-y));
  }
  cout << ans << newl;
  return 0;
}

Measured memory_bytes: 4708
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef  long long int ll;
typedef long double db;
#define pb push_back
#define mp make_pair
#define ub(v,val) upper_bound(v.begin(),v.end(),val)-v.begin()
#define lb(v,val) lower_bound(v.begin(),v.end(),val)-v.begin()
#define sortv(vec) sort(vec.begin(),vec.end())
#define rev(p) reverse(p.begin(),p.end());
#define v vector
#define PI 3.1415926535
#define len length()
#define repc(i,s,e) for(ll i=s;i<e;i++)
#define fi first
#define se second
#define mset(a,val) memset(a,val,sizeof(a));
#define mt make_tuple
#define repr(i,n) for(i=n-1;i>=0;i--)
#define rep(i,n) for(i=0;i<n;i++)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const int M = 1e9 + 7;
int INF = 1e6;

ll n, m;


int main() {
	// your code goes here
	IOS;

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ll i, j, t, k, x, y, z,  N;
	cin >> x >> y >> z;
	cin >> k;
	ll flg = 0;
	if (y <= x) {
		while (y <= x) {
			y *= 2;
			k--;
		}
		if (k < 0)
			flg = 1;
	}
	if (z <= y) {
		while (z <= y) {
			z *= 2;
			k--;
		}
		if (k < 0)
			flg = 1;
	}
	if (flg)
		cout << "No";
	else cout << "Yes";






	return 0;
}

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

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//#include <atcoder/all>
//using namespace atcoder;
template <typename T> bool chmax(T &u, const T z) { if (u < z) {u = z; return true;} else return false; }
template <typename T> bool chmin(T &u, const T z) { if (u > z) {u = z; return true;} else return false; }
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
typedef pair<ll, ll> P;
const ll INF = 1LL << 60;
//const int MOD = 1000000007;
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }

int main(){
  string s;
  cin>>s;
  string t="CODEFESTIVAL2016";
  int cnt=0;
  rep(i,16){
    if(s[i]!=t[i])cnt++;
  }
  cout<<cnt<<endl;
  return 0;
}

Measured memory_bytes: 3620
/*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i=(m);i<(n);i++)
#define rrep(i,m,n) for(ll i=(m);i>=(n);i--)
#define printa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
void print() {}
template <class H,class... T>
void print(H&& h, T&&... t){cout<<h<<" \n"[sizeof...(t)==0];print(forward<T>(t)...);}
struct Combination{
private:
    ll N;
    vector<ll> fac, facinv;

public:
    Combination(ll n){
        N = n;
        fac.push_back(1); fac.push_back(1);
        rep(i,2,N+1) fac.push_back(fac[i-1] * i % MOD);
        rep(i,0,N+1) facinv.push_back(power(fac[i], MOD-2));
    }
    ll power(ll x, ll n){
        if(n == 0) return 1LL;
        ll res = power(x * x % MOD, n/2);
        if(n % 2 == 1) res = res * x % MOD;
        return res;
    }
    ll nck(ll n, ll k){
        if(k == 0 || n == k) return 1LL;
        return fac[n] * facinv[k] % MOD * facinv[n-k] % MOD;
    }
    ll npk(ll n, ll k){
        if(k == 0) return 1LL;
        return fac[n] * facinv[n-k] % MOD;
    }
    ll get(ll x){return fac[x];};
    ll getinv(ll x){return facinv[x];};
};

void solve(){
    ll N,M;
    cin >> N >> M;
    Combination cb(500010);
    ll ans = cb.npk(M,N) * cb.npk(M,N) % MOD;
    rep(i,1,N+1){
        ll v1 = cb.nck(N,i);
        ll v2 = cb.npk(M,i);
        ll v3 = cb.npk(M-i,N-i) * cb.npk(M-i,N-i) % MOD;
        ll v = v1 * v2 % MOD * v3 % MOD;
        if(i % 2 == 0){
            ans += v;
            ans %= MOD;
        }else{
            ans = (ans - v + MOD) % MOD;
        }
    }
    print(ans);

    

}

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

Measured memory_bytes: 13200
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef pair<int,int> P;
int main(){
  int n;
  cin >> n;
  
  int x[n],l[n];
  rep(i,n) cin >> x[i] >> l[i];
  
  P num[n];
  rep(i,n){
    num[i].first = x[i] + l[i];
    num[i].second = i;
  }
  
  sort(num, num + n);
  
  //rep(i,n) cout << num[i].first << ":" << num[i].second << endl;
  //cout << endl;
  
  int ans = 1, ex = num[0].second;
  rep(i,n){
    if(i == 0) continue;
    int j = num[i].second;
    if(x[ex]+l[ex] > x[j]-l[j]) continue;
    ans++;
    ex = j;
  }
  
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 1792
dic={}
for i in range(1,10):
  for j in range(0,10):
    dic[(i,j)]=0

N=int(input())
for i in range(1,min([N+1,10])):
  dic[(i,i)]+=1
for i in range(10,min([N+1,100])):
  dic[(i//10,i%10)]+=1
for i in range(100,min([N+1,1000])):
  dic[(i//100,i%10)]+=1
for i in range(1000,min([N+1,10000])):
  dic[(i//1000,i%10)]+=1
for i in range(10000,min([N+1,100000])):
  dic[(i//10000,i%10)]+=1
for i in range(100000,N+1):
  dic[(i//100000,i%10)]+=1
  
ans=0
for i in range(1,10):
  for j in range(1,10):
    x=dic[(i,j)]
    y=dic[(j,i)]
    ans+=x*y
print(ans)


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

using namespace std;

#define int long long

void solve() {
    int a, b, m;
    cin >> a >> b >> m;
    int as[a], bs[b];
    for (int i = 0; i < a; ++i) cin >> as[i];
    for (int i = 0; i < b; ++i) cin >> bs[i];
    int ans = 0;
    int mi = as[0];
    for (int i = 0; i < a; ++i) mi = min(mi, as[i]);
    ans += mi;
    mi = bs[0];
    for (int i = 0; i < b; ++i) mi = min(mi, bs[i]);
    ans += mi;
    for (int i = 0; i < m; ++i) {
        int x, y, c;
        cin >> x >> y >> c;
        ans = min(ans, as[x - 1] + bs[y - 1] - c);
    }
    cout << ans;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    solve();
    return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
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; }

const int mod=1e9+7;
const int INF=1001001001;


int main() {
  int N,M;
  cin>>N>>M;
  vector<int64_t>A(M);
  vector<int64_t>C(M);
  for(int i=0;i<M;i++){
    cin>>C[i];
    int b;
    cin>>b;
    for(int j=0;j<b;j++){
      int c;
      cin>>c;
      A[i]|=(1<<(c-1));
    }
  }
  vector<int64_t>dp(1<<N,INF);
  dp[0]=0;
  for(int i=0;i<M;i++){
    for(int j=0;j<(1<<N);j++){
      if(dp[j]==INF){continue;}
      chmin(dp[j|A[i]],dp[j]+C[i]);
    }
  }
  if(dp[(1<<N)-1]==INF){cout<<-1<<endl;}
  else{cout<<dp[(1<<N)-1]<<endl;}
  return 0;  
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define MAX(a,b) a=a>b?a:b
#define MIN(a,b) a=a<b?a:b
#define REP(i,x,n) for(int i=x;i<n;i++)
#define REPR(i,x,n) for(int i=n-1;i>=x;i--)
#define pb  push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLr(obj) (obj).rbegin(), (obj).rend()
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int, int> P;


int main(){
   ll n,m;
   cin>>n>>m;
   ll ans=min(n,m/2);
   if(n<=m/2){
      m-=n*2;
      ans+=m/4;
   }
   cout<<ans<<endl;
   
}


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

int main(){
	int s;
	cin>>s;
	int a=s/100;
	int b=s%100;
	if(1<=a && a<=12){
		if(1<=b && b<=12) cout<<"AMBIGUOUS";
		else cout<<"MMYY";
	} else{
		if(1<=b && b<=12) cout<<"YYMM";
		else cout<<"NA";
	}
}

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

#ifdef LOCAL
#include "../../dump.hpp"
#else
#define dump(...)
#endif

#define int ll
#define rep(i,n) for(int i=0,i##_cond=(n);i<i##_cond;++i)
#define FOR(i,a,b) for(int i=(a),i##_cond=(b);i<i##_cond;++i)
#define ROF(i,a,b) for(int i=(a)-1,i##_cond=(b);i>=i##_cond;--i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend() //sortで降順
#define pb push_back
#define eb emplace_back
#define fst first
#define snd second
using ll  = long long;
using vi  = vector<int>;
using vvi = vector<vi>;
using vs  = vector<string>;
using pii = pair<int,int>;
constexpr ll inf = 1ll<<61;
constexpr ll mod = 1e9+7;
template<class T>bool chmax(T &a, const T &b){if(a<b){a=b; return true;} return false;}
template<class T>T add(const T &a, const T &b){return (a+b)%mod;}

signed main(){
  int n; cin >> n;
  vi p(n); rep(i,n) cin >> p[i];
  int ans = 0;
  rep(i,n-2){
    vi tmp;
    rep(j,3) tmp.push_back(p[i+j]);
    sort(all(tmp));
    if(tmp[1] == p[i+1]) ans++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
n = int(input())
x = list(map(int, input().split()))
val = sorted(x)
first = 0
second = 0
ival = 0
for i in range(n):
    if i == n//2:
        first = val[i-1]
        second = val[i]
        ival = i-1
#print(first)
#print(second)
#print(ival)
for i in range(n):
    if x[i] <= first:
        print(second)
    else:
        print(first)

Measured memory_bytes: 93908
N,K,Q = list(map(int,input().split()))
A = [int(input()) for i in range(Q)]
P = N*[K-Q]

for a in A:
  P[a-1]+=1

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

Measured memory_bytes: 10472
fun main(args: Array<String>) {
  val n = readLine()!!.toInt()
  val a = readLine()!!.split(" ").map { it.toInt() }
  var ans = mutableListOf<Int>()
  for (i in -100..100) {
    var sum = 0
    for (x in a) {
      sum += (x - i) * (x - i)
    }
    ans.add(sum)
  }
  println(ans.min()!!)
}


Measured memory_bytes: 37844
#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<cmath>
using namespace std;
char qwer;
int read()
{
    int f(1),x(0);
    for(qwer=getchar();!isdigit(qwer);qwer=getchar())if(qwer=='-') f=-1;
    for(;isdigit(qwer);qwer=getchar()) x=x*10+qwer-'0';
    return f*x;
}
int u,v;
int st[100001],ed[100001],son[100001],cnt;
int head[100001],nxt[200001],to[200001],fa[100001],tot=1;
long long n,m,f[100001],suffix[100001],preffix[100001];
void getfa(int u)
{
    st[u]=cnt;
    for(int i=head[u];i;i=nxt[i])
        if(to[i]!=fa[u])
            son[cnt++]=to[i],fa[to[i]]=u;
    ed[u]=cnt;
    for(int i=st[u];i<ed[u];i++) getfa(son[i]);
}
void DFS(int u)
{
    f[u]=suffix[u]=preffix[u]=1;
    for(int i=st[u];i<ed[u];i++)
    {
        DFS(son[i]);
        f[u]=(f[u]*(f[son[i]]+1))%m;
    }
    for(int i=st[u]+1;i<ed[u];i++) preffix[son[i]]=(preffix[son[i-1]]*(f[son[i-1]]+1))%m;
    for(int i=ed[u]-2;i>=st[u];i--) suffix[son[i]]=(suffix[son[i+1]]*(f[son[i+1]]+1))%m;
}
void DFS2(int u,long long offset)
{
    long long tmp;
    for(int i=st[u];i<ed[u];i++) 
    {
        tmp=(preffix[son[i]]*suffix[son[i]]%m*offset+1)%m;
        f[son[i]]=f[son[i]]*tmp%m;;   
        DFS2(son[i],tmp);
    }
}
inline void addEdge(int u,int v)
{
    nxt[tot]=head[u]; 
    to[tot]=v;
    head[u]=tot++;
}
int main()
{
    n=read(); m=read();
    for(int i=1;i<n;i++)
    {
        u=read(); v=read();
        addEdge(u,v);
        addEdge(v,u);
    }
    getfa(1);
    DFS(1);
    DFS2(1,1);
    //for(int i=1;i<=n;i++){printf("%d:",i);for(int j=st[i];j<ed[i];j++)printf("%d ",son[j]);printf("\n");};
    //for(int i=1;i<=n;i++) printf("%d:%lld %lld %lld\n",i,f[i],suffix[i],preffix[i]);
    for(int i=1;i<=n;i++) printf("%lld\n",f[i]);
    return 0;
}

Measured memory_bytes: 9344
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+5;
ll a,b,c,k;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>a>>b>>c>>k;
	ll res;
	if(k%2)
		res=b-a;
	else
		res=a-b;
	cout<<res<<'\n';
	return 0;
}


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

int main ( void ) {

    char a[200], b[200];
    int n, m;

    while ( 1 ) {

        scanf ( "%s", a );
        if ( strcmp ( a, "-" ) == 0 ) break;
        
        scanf ( "%d", &n );
        int l = strlen ( a );

        for ( int i = 0; i < n; i++ ) {
            scanf ( "%d", &m );
            for ( int j = 0, k = m; j < l - m; j++, k++ ){
                b[j] = a[k];
            }
            for ( int j = l - m, k = 0; j < l; j++, k++ ){
                b[j] = a[k];
            }
            for ( int j = 0; j < l; j++ ) {
                a[j] = b[j];
            }
        }

        printf ( "%s\n", a );

    }

    return 0;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
const long long INF = 1LL << 60;
const long long MOD = 1000000007;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep1(i, n) for (ll i = 1; i <= (n); ++i)
#define rrep(i, n) for (ll i = (n - 1); i >= 0; --i)
#define perm(c) sort(ALL(c));for(bool c##p=1;c##p;c##p=next_permutation(ALL(c)))
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define MAX max<ll>
#define MIN min<ll>
#define pb push_back
#define to_s to_string
#define len(v) (ll)v.size()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define print(x) cout << (x) << '\n'
#define drop(x) cout << (x) << '\n', exit(0)
#define debug(x) cout << #x << ": " << (x) << '\n'
using namespace std;
using ll = long long;
typedef pair<ll, ll> P;
typedef vector<ll> vec;
typedef vector<vector<ll>> vec2;
typedef vector<vector<vector<ll>>> vec3;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
ll devc(ll x, ll y) { return (x + y - 1) / y; }

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(20);

    ll N;
    cin >> N;
    ll sum = 0;
    rep1(i, N) if (!(i % 3 == 0 or i % 5 == 0)) sum += i;
    print(sum);

    return 0;
}

Measured memory_bytes: 3652
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
class Main{
	public static void main(String[] args)throws NumberFormatException, IOException{
		//System.out.print(" ");
		Scanner scan = new Scanner(System.in);
		ArrayList<Integer> NN = new ArrayList<Integer>();
		ArrayList<Integer> XX = new ArrayList<Integer>();
		int n=1;
		int x=1;
		int kumi =0;
		while(n != 0 || x!= 0){
			n =scan.nextInt();
			x =scan.nextInt();
			NN.add(n);
			XX.add(x);
//			System.out.println("scaning");
		}
//		System.out.println("finir");
		for (int i=0;i<NN.size()-1;i++){
				kumi = 0;
			for(int i1=0;i1<NN.get(i);i1++){
				for(int i2=0;i2<NN.get(i);i2++){
					for(int i3=0;i3<NN.get(i);i3++){
						int N1 = i1+1;
						int N2 = i2+1;
						int N3 = i3+1;
//						System.out.println(N1 +" "+ N2 +" "+ N3);
						if( N1 == N2 || N2 == N3 || N3 == N1){
							//???????????????
							//System.out.println("T");
						}
						else{
							if(N1+N2+N3 == XX.get(i)){
								kumi += 1;
//								System.out.println(N1+N2+N3);
//								System.out.println(XX.get(i));
							}

						}
					}
				}
			}
			System.out.println(kumi/6);
		}
	}
}

Measured memory_bytes: 27520
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;

int N, Q;

struct SegmentTree {
private:
    int n;
    vector <int> node;

public:
    SegmentTree(vector <int> v) {
        int sz = v.size();
        n = 1;
        while (n < sz) n *= 2;
        node.resize(2*n-1, 0);
    }

    void add(int x, int val) {
        x += n - 1;
        node[x] += val;
        while (x > 0) {
            x = (x - 1) / 2;
            node[x] = node[2*x+1] + node[2*x+2];
        }
    }

    int getsum(int a, int b, int k=0, int l=0, int r=-1) {
        if (r < 0) r = n;
        if (r <= a || b <= l) return 0;
        if (a <= l && r <= b) return node[k];
        int vl = getsum(a, b, 2*k+1, l, (l+r)/2);
        int vr = getsum(a, b, 2*k+2, (l+r)/2, r);
        return vl + vr;
    }
};

int main() {
    cin.sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    cin >> N >> Q;
    SegmentTree seg(vector<int>(N, 0));
    for (int i = 0; i < Q; i++) {
        int c, x, y;
        cin >> c >> x >> y;
        if (c == 0) {
            seg.add(x-1, y);
        } else {
            cout << seg.getsum(x-1, y) << "\n";
        }
    }

    return 0;
}


Measured memory_bytes: 4056
import java.util.Scanner;

class Main
{
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		int c = scanner.nextInt();
                if(a < b && b < c)
		{
			System.out.println(a + " " + b + " " + c);	
		}
		if(a > b && b > c)
		{
			System.out.println(c + " " + b + " " + a);
		}
		if(a > b && b == c)
		{
			System.out.println(b + " " + c + " " + a);
		}
		if(a > b && b < c)
		{	
			if(a < c)
			{
				System.out.println(b + " " + a + " " + c);
			}
			if(c < a)
			{
				System.out.println(b + " " + c + " " + a);
			}
			if(a == c)
			{
				System.out.println(b + " " + a + " " + c);
			}
		}
		if(a < b && b > c)
		{
			if(a < c)
			{ 
				System.out.println(a + " " + c + " " + b);
			}
			if(c < a)
			{
				System.out.println(c + " " + a + " " + b);
			}
			if(a == c)
			{ 
				System.out.println(a + " " + c + " " + b);
			}
		}
	}
}
		


Measured memory_bytes: 26312
import java.util.*;
import java.util.stream.IntStream;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        long hs[] = new long[N];
        for(int i = 0;i < N;i++)
            hs[i] = sc.nextLong();

        long dp[] = new long[N];
        for(int i = 0;i < N;i++)
            dp[i] = Long.MAX_VALUE;
        dp[0] = 0;
        for(int i = 1;i < N;i++) {
            long min = Long.MAX_VALUE ;
            for(int h = 1;h <= K && i - h >= 0;h++){
                long tmp = dp[i - h] + Math.abs(hs[i] - hs[i - h]);
                if(min > tmp)
                    min = tmp;
            }
            dp[i] = min;
        }

        System.out.println(dp[N - 1]);

    }










    public static Integer min(List<Integer> ar){
        int min = 10000;
        int index = 0;
        for(int i = 0; i< ar.size();i++){
            if(min > ar.get(i)){
                min = ar.get(i);
                index = i;
            }
        }
        return min;
    }
}


Measured memory_bytes: 60216
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using V = vector<int>;
using A = array<int, 2>;
using P = pair<int, int>;
constexpr int MOD{1000000000 + 7};
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
constexpr array<int, 4> dx{1, 0, -1, 0}, dy{0, 1, 0, -1};
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
constexpr int div_roundup(int a, int b)
{
    return (a + b - 1) / b;
}
// power with modulo
ll powMod(ll b, ll e, const ll m = MOD)
{
    ll r = 1;
    for (; e > 0; e >>= 1)
    {
        if (e & 1)
            r = (r * b) % m;
        b = (b * b) % m;
    }
    return r;
}
// factrial with modulo
ll factMod(const ll n, const ll m = MOD)
{
    ll x = 1;
    for (ll i = 1; i <= n; ++i)
        x = (x * i) % m;
    return x;
}
class Combi
{
private:
    const int n_, mod_;
    vector<ll> fac_, finv_;

public:
    Combi(int n = 10000, int mod = MOD);
    ll count(int n, int k);
};
Combi::Combi(int n, int mod) : n_(n), mod_(mod)
{
    fac_.resize(n_);
    finv_.resize(n_);
    vector<ll> inv(n_);

    fac_[0] = fac_[1] = 1;
    finv_[0] = finv_[1] = 1;
    inv[1] = 1;

    for (int i = 2; i < n_; i++)
    {
        fac_[i] = fac_[i - 1] * i % mod_;
        inv[i] = mod_ - inv[mod_ % i] * (mod_ / i) % mod_;
        finv_[i] = finv_[i - 1] * inv[i] % mod_;
    }
}
ll Combi::count(int n, int k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac_[n] * (finv_[k] * finv_[n - k] % mod_) % mod_;
}

// vector<vector<int>> vec(n_rows, vector<int>(n_cols, value));

// *****************************************************************************

bool check(V a, V b)
{
    int x = 0;
    const int n = a.size();

    rep(i, n)
    {
        x += pow(a[i] - b[i], 2);
    }

    for (int i = 1; i < 200; i++)
    {
        if (x == i*i)
            return true;
    }
    return false;
}

void solve()
{
    int n, d;
    cin >> n >> d;

    vector<vector<int>> x(n, vector<int>(d));

    rep(i, n)
        rep(j, d)
    {
        cin >> x[i][j];
    }

    int count = 0;

    for (int i = 0; i < n; i++)
        for (int j = i + 1; j < n; j++)
        {
            count += check(x[i], x[j]);
        }

    cout << count << endl;
}

// *****************************************************************************

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(0);

    solve();
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef map<int,int> mii;
typedef vector<int> vi;
typedef vector<vector<int>> vii;
typedef vector<long long> vl;
typedef vector<vector<ll>> vll;
typedef vector<bool> vb;
typedef set<int> si; 
typedef queue<int> qi;
typedef stack<int> sti;
typedef priority_queue<int> pqi;
#define fori(i,a,b) for(int i = (a); i < (b); ++i)
#define rep(i,b,a) for(int i = (b); i >= (a); --i)
#define all(a) (a).begin(), (a).end()
//#define __builtin_popcountll bitCountLL
//#define __builtin_popcount bitCount
//__builtin_ctz 末尾0的个数, __builtin_clz 前导0的个数
//__builtin_ffs 最后一个1的位置
#define maxn 100005
#define Mod 1000000007
const int INF = 2e9;
const ll ML = 4e18;
    
void solve() {
    int n, d;
    cin >> n >> d;
    int ans = 0;
    ll dist = ll(d) * d;
    fori(i,0,n)  {
        ll a,b;
        cin  >> a >> b;
        if(a * a + b * b <= dist) ans++;
    }
    cout << ans;
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
	//cout.precision(30); cout << fixed;
	//freopen("D:\\data_in.txt", "r", stdin);
   
    solve();
   
    /*
    clock_t start,finish;
    start = clock();
    
    finish = clock();
    cout << "\n" << (double)(finish - start) / (double)(CLOCKS_PER_SEC) * 1000 << "ms" << endl;
    */
    return 0;
}

/***************************************************************
 question:
 idea:
 tag:
 record:
 ***************************************************************/


Measured memory_bytes: 3648
require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

N = get_int

NUM = 1000000000000001

chars = ['z', *'a'..'y']

result = ''
stock = N
while stock > 0
  result += chars[stock % 26]

  if stock % 26 == 0
    stock -= 26
  end
  stock /= 26
end

puts result.reverse


Measured memory_bytes: 14456
s = str(input())

num = [int(s[-1])]
for i in range(1, len(s)):
    tmp = num[-1] + pow(10, i, 2019) * int(s[-i - 1])
    num.append(tmp % 2019)

mod = [1] + [0] * 2018
ans = 0
for i in num:
    m = i % 2019
    ans += mod[m]
    mod[m] += 1
print(ans)


Measured memory_bytes: 79356
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define sz(x) int(x.size())
#define pb push_back
#define eb emplace_back
using ll=long long;
using P = pair<int,int>;
using LP=pair<ll,int>;
#define chmax(x,y) x = max(x,y)
#define chmin(x,y) x = min(x,y)
const ll MOD=1000000007,MOD2=998244353;



int main() {
    double N,T,A;
    cin>>N>>T>>A;
    vector<double> H(N);
    rep(i,N){cin>>H.at(i);}
    rep(i,N){
        H.at(i)=T-H.at(i)*0.006;
    }
    int ans=0;
    rep(i,N){
        if(abs(A-H.at(i))<abs(A-H.at(ans))){
            ans=i;
        }
    }
    cout<<ans+1<<endl;
}

Measured memory_bytes: 3692
#include <iostream>
#include <cstring>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <math.h>
#include <string>
#include <map>
#include <cstdlib>
using namespace std;

typedef long long ll;

int main()
{
    int N,Y;
    cin >> N >> Y;
    
    for(int i=0; i<=N; i++){
        for(int j=0; j<=N-i; j++){
            if((N-i-j)*1000==Y-i*10000-j*5000){
                cout << i << ' ' << j << ' ' << N-i-j << endl;
                return 0;
            }
        }
    }
    
    cout << "-1 -1 -1" << 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 INF = 1e11;

int main() {
  int n, kk;
  cin >> n >> kk;
  vector<ll> v(n);
  rep(i, n) cin >> v[i];

  int m = min(n, kk);
  ll ans = -1LL*INF;
  for (int i = 0; i <= m; ++i) {
    for (int j = 0; i + j <= m; ++j) {
      ll val = 0;
      int c = kk - i - j;
      vector<ll> a;
      for (int k = 0; k < i; ++k) a.push_back(v[k]);
      for (int k = 0; k < j; ++k) a.push_back(v[n - 1 - k]);
      for (auto aa : a) val += aa;
      sort(a.begin(), a.end());
      for (int k = 0; k < c && k < a.size() && a[k] < 0; ++k) val -= a[k];
      ans = max(ans, val);
    }
  }

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


Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		long[] map = new long[N];
		for (int i = 0; i < N; i++) {
			map[i] = sc.nextLong();
		}
		
		Arrays.sort(map);
		
		long a = 0;
		for (int i = map.length - 1; i > 0; i--) {
			if (map[i] == map[i - 1]) {
				a = map[i];
				map[i] = -1;
				map[i - 1] = -2;
				break;
			}
		}
		
		Arrays.sort(map);
		
		long b = 0;
		for (int i = map.length - 1; i > 0; i--) {
			if (map[i] == map[i - 1]) {
				b = map[i];
				break;
			}
		}
		
		long ans = a * b;
		System.out.println(ans);
	}
}

Measured memory_bytes: 59124
n=int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
rieki = 0
sonsitsu = 0
for i in range(n):
    if v[i] > c[i]:
        rieki += v[i]
        sonsitsu += c[i]
print(rieki-sonsitsu)

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

int main()
{
	vector<int> v(4, 0);
	int n;
	cin >> n;
	while (n > 0){
		string s;
		cin >> s;
		if (s == "AC") v[0] += 1;
		else if (s == "WA") v[1] += 1;
		else if (s == "TLE") v[2] += 1;
		else if (s == "RE") v[3] += 1;
		n--;
	}
	
	cout << "AC x " << v[0] <<'\n';
	cout << "WA x " << v[1] <<'\n';
	cout << "TLE x " << v[2] <<'\n';
	cout << "RE x " << v[3] <<'\n';
    return 0;
}

Measured memory_bytes: 3200
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define ALL(x) (x).begin(),(x).end()
const long long MOD = 1000000007;
const long long INF = 1LL << 60;

int main(){
	set<int> P;
	rep(i, 3){
		int a;
		cin >>a;
		P.insert(a);
	}
	cout << P.size() << endl;
}

Measured memory_bytes: 256