akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
int main()
{
    int n,x;
    scanf("%d%d",&n,&x);
    
    int i,l[1000],cnt=1,sum=0;
    
    for(i=0;i<n;i++)
    {
        scanf("%d",&l[i]);
        sum+=l[i];
        
        if(sum<=x)
        {
            cnt++;
        }
    }
    printf("%d\n",cnt);
    return 0;
}

Measured memory_bytes: 128
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def main():
    H, W = map(int, input().split())
    field = []
    for _ in range(H):
        field.append(list(map(int, input().split())))

    ans = []
    for y in range(H):
        if y % 2 == 0:
            for x in range(W - 1):
                if field[y][x] > 0 and field[y][x] % 2 == 1:
                    ans.append((y + 1, x + 1, y + 1, x + 2))
                    field[y][x] -= 1
                    field[y][x + 1] += 1

            if y != H - 1:
                if field[y][-1] > 0 and field[y][-1] % 2 == 1:
                    ans.append((y + 1, W, y + 2, W))
                    field[y][-1] -= 1
                    field[y + 1][-1] += 1

        else:
            for x in range(W - 1, 0, -1):
                if field[y][x] > 0 and field[y][x] % 2 == 1:
                    ans.append((y + 1, x + 1, y + 1, x))
                    field[y][x] -= 1
                    field[y][x - 1] += 1

            if y != H - 1:
                if field[y][0] > 0 and field[y][0] % 2 == 1:
                    ans.append((y + 1, 1, y + 2, 1))
                    field[y][0] -= 1
                    field[y + 1][0] += 1

    print(len(ans))
    for a in ans:
        print(*a)


if __name__ == '__main__':
    main()


Measured memory_bytes: 27468
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
 
typedef pair<int,int> P;
struct edge{int to, id;};
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define mod 1000000007

int main(){
    ll n;
    cin >> n;
    vector<ll> a;
    rep(i,n){
        ll temp;
        cin >> temp;
       a.push_back(temp);
    }
    sort(a.begin(),a.end(),greater<ll>());
    ll ans = 0;
    ans += a[0];
    ll upper = (n-2) / 2;
    for(int i = 1; i <= upper; i++){
        ans += a[i] * 2;
    }
    if(n % 2 != 0) ans += a[(n-2) / 2+1];
    cout << ans << endl;


}

Measured memory_bytes: 5276
import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayDeque;
import java.util.Queue;
import java.util.LinkedList;

public class Main {

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

    void solve() {
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();
        int W = sc.nextInt();
        int D = sc.nextInt();
        int A;
        int px[] = new int[H * W + 1];
        int py[] = new int[H * W + 1];
        int d[] = new int[H * W + 1];
        int ans = 0;
        Arrays.fill(px, 0);
        Arrays.fill(py, 0);
        Arrays.fill(d, 0);
        for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
                A = sc.nextInt();
                px[A] = i;
                py[A] = j;
            }
        }
        for (int i = D + 1; i < H * W + 1; i++) {
            d[i] = d[i - D] + (int) Math.abs(px[i] - px[i - D]) + (int) Math.abs(py[i] - py[i - D]);
        }
        int Q = sc.nextInt();
        for (int i = 0; i < Q; i++) {
            int L = sc.nextInt();
            int R = sc.nextInt();
            System.out.println(d[R] - d[L]);
        }
    }
}

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

signed main(void)
{
	int n;
	vector<int> p(50);
	bool flag;

	cin >> n;
	rep(i, n) cin >> p[i];
	rep(i, n - 1)
	{
		For(k, i, n)
		{
			swap(p[i], p[k]);
			flag = true;
			rep(j, n - 1)
			{
				if (p[j] > p[j + 1])
				{
					flag = false;
					break;
				}
			}
			if (flag)
			{
				cout << "YES" << endl;
				return 0;
			}
			swap(p[k], p[i]);
		}
	}
	cout << "NO" << endl;
	return 0;
}


Measured memory_bytes: 256
from fractions import gcd
from functools import reduce
     
mod = 10 ** 9 + 7
     
def lcm_base(x, y):
    return (x * y) // gcd(x, y)
     
def lcm(numbers):
    return reduce(lcm_base, numbers, 1)
     
    # print('input >>')
N = int(input())
A = list(map(int,(input().split())))
     
lcmn = lcm(A)
    
ans = 0
for i in range(len(A)):
    ans += lcmn // A[i]
     
    # print('-----output-----')
print(int(ans%mod))

Measured memory_bytes: 6136
N = int(input())

List = [int(i) for i in input().split(" ")[::-1]]

Min = List[0]
i=1
flag = 0

for i in range(N):
    if (List[i]-Min)>=2:
        flag=1
        break
    else:
        if List[i]<Min:
            Min=List[i]
if flag==0:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 14864
parseline(str) = parse.(Int, split(str))
function NotDivisible()
    N = parse(Int, readline())
    A = sort(parseline(readline()))
    M = A[end]
    ans = zeros(Int, M)
    for a in A
        ans[a] > 1 && continue
        ans[a] += 1
        for i in 2a:a:M
            ans[i] += 2
        end
    end
    println(sum(ans.==1))
end
NotDivisible()

Measured memory_bytes: 217524
from fractions import gcd
N, *A = map(int, open(0).read().split())

L = [0]*N
L[0] = v = A[0]
for i in range(N-1):
    L[i+1] = v = gcd(v, A[i+1])
R = [0]*N
R[-1] = v = A[-1]
for i in range(N-1, -1, -1):
    R[i] = v = gcd(v, A[i])
ans = max(L[-1], L[-2], R[1])
for i in range(1, N-1):
    ans = max(ans, gcd(L[i-1], R[i+1]))
print(ans)

Measured memory_bytes: 16148
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
using namespace std;

int main(){
	char s[55];
	scanf("%s",s+1);
	int p = 0;
	for(int i = 1;;i++){
		if(s[i] != 0) p++;
		else break;
	}
	for(int i = 1;i <= p - 8;i++){
		printf("%c",s[i]);
	}
	printf("\n");
	return 0;
}

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

int main() {
   int N;
   cin >> N;
   int count=0;
   for (int i=1; i<1+N; i++) {
       string s=to_string(i);
       if (s.size()%2==1) count++;
   }
   cout << count << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;class Main{public static void main(String[] q){Scanner c=new Scanner(System.in);for(;;){int n=c.nextInt(),s=c.nextInt();if(n==0&&s==0)break;System.out.println(f(0, 0, s, n));}}static int f(int x,int a,int t,int n){if(n==0)return x==t?1:0;if(a>9)return 0;return f(x+a,a+1,t,n-1)+f(x,a+1,t,n);}}

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

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n, m;
	cin >> n >> m;
	vector<int> a(n);
	int sum  = 0;
	for(int& x : a) {
		cin >> x;
		sum += x;
	}
	int ans = 0;
	for(int x : a) {
		ans += x * (4 * m) >= sum;
	}
	
	cout << (ans >= m ? "Yes" : "No") << endl;
}


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

using namespace std;

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

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

ll modinv(ll a){
  ll b = MOD-2, r = 1;
  while(b){
    if(b&1)r=r*a%MOD;
    a=a*a%MOD;
    b>>=1;
  }
  return r;
}

int n,m;
int a[1252], b[1252];
ll fact[1252525];

int main(){
  scanf("%d%d",&n,&m);
  REP(i,n)scanf("%d",a+i);
  REP(i,m)scanf("%d",b+i);
  sort(a,a+n); sort(b,b+m);
  if(a[n-1] != b[m-1]){
    puts("0"); return 0;
  }
  REP(i,n-1)if(a[i]==a[i+1]){
    puts("0"); return 0;
  }
  REP(i,m-1)if(b[i]==b[i+1]){
    puts("0"); return 0;
  }
  fact[0] = 1;
  FOR(i,1,1252525)fact[i] = fact[i-1]*i%MOD;
  ll ans = 1;
  int sum = 0;
  int ait = 0, bit = 0;
  while(ait<n || bit<m){
    int po = 0, v = 0;
    bool du = false;
    if(ait<n && bit<m && a[ait] == b[bit]){
      v = a[ait++]; bit++;
      po = n+m-ait-bit;
      du = true;
    }else if(bit==m || (ait!=n && a[ait] < b[bit])){
      v = a[ait++];
      po = m-bit-1;
    }else{
      v = b[bit++];
      po = n-ait-1;
    }
    int aa = v-1-sum;
    int bb = po;
    sum += po+1;
    // DEBUG(po); DEBUG(v); DEBUG(sum);
    if(sum > v){
      ans = 0; break;
    }
    ans = ans * fact[aa] % MOD * modinv(fact[aa-bb]) % MOD;
    if(!du){
      ans = ans * (po+1) % MOD;
    }
  }
  printf("%lld\n",ans);
  return 0;
}


Measured memory_bytes: 9984
package main

import (
	"bufio"
	"fmt"
	"log"
	"math"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	log.SetFlags(log.Lshortfile)
	a := nextInt()
	b := nextInt()
	if a > b {
		a, b = b, a
	}
	c := a
	for {
		if c%b == 0 {
			fmt.Println(c)
			break
		}
		c += a
	}
}

func nextString() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

var dy = []int{0, 1, 0, -1}
var dx = []int{1, 0, -1, 0}
var MAX = math.MaxInt32

func pow(a, b int) int {
	return int(math.Pow(float64(a), float64(b)))
}

func lcm(a, b int) int {
	return a * b / gcd(a, b)
}
func gcd(a, b int) int {
	if a < b {
		a, b = b, a
	}
	for b != 0 {
		a, b = b, a%b
	}
	return a
}
func max(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r < a[i] {
			r = a[i]
		}
	}
	return r
}
func min(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r > a[i] {
			r = a[i]
		}
	}
	return r
}
func sum(a []int) (r int) {
	for i := range a {
		r += a[i]
	}
	return r
}
func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

type pair struct {
	a, b int
}

type pairs []pair

func (p pairs) Len() int {
	return len(p)
}
func (p pairs) Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}

func (p pairs) Less(i, j int) bool {
	if p[i].a == p[j].a {
		return p[i].b < p[j].b
	}
	return p[i].a < p[j].a
}


Measured memory_bytes: 640
#pragma region
#include <bits/stdc++.h>
using namespace std;
inline void ci(void){
  return;
}
template <typename First, typename... Rest>
void ci(First& first, Rest&... rest){
  cin >> first;
  ci(rest...);
  return;
}
inline void co(void){
  cout << "\n";
  return;
}
template <typename First, typename... Rest>
void co(First first, Rest... rest){
  cout << first << " ";
  co(rest...);
  return;
}
#define ll long long
#define ld long double
#define st string
#define dl double
#define wh while
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define tp tuple
#define ft first
#define sc second
#define ve vector
#define tos to_string
#define len length
#define rt return 0
#define br break
#define con continue
#define lcm(n, m) (n * m / gcd(n, m))
#define np next_permutation
#define repi(i, m, n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i, n) repi(i, 0, n)
#define repill(i, m, n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define repll(i, n) repill(i, 0, n)
#define revi(i, m, n) for(int i=(int)(m);i>(int)(n);i--)
#define rev(i, n) revi(i, 0, n)
#define revill(i, m, n) for(ll i=(ll)(m);i>(ll)(n);i--)
#define revll(i, n) revill(i, 0, n)
#define sz(v) ((int)(v).size()) 
#define each(i, n) for(auto&& i: n)
#define all(n) (n.begin(), n.end())
#define allr(n) (n.rbegin(), n.rend())
#define sp(n) cout << fixed << setprecision(n)
#pragma endregion
// sqrt ルート, int 2*10^9, gcd　最大公約数
// __builtin_popcount bitの個数

int main() {
  int x;
  ci(x);
  if(x < 1200){
    co("ABC");
  }
  else{
    co("ARC");
  }
}

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

int main(){
    int n;
    cin>>n;
    string s;
    ll cur=-2;
    if(n==0){
        cout<<0<<endl;
        return 0;
    }
    while(n){
        if(abs(n%cur)>0){
            s+='1';
            n-=cur/-2;
        }
        else s+='0';
        cur*=-2;
        //cerr<<n<<" "<<cur<<endl;
    }
    reverse(s.begin(),s.end());
    cout<<s<<endl;
    return 0;
}


Measured memory_bytes: 256
N,K = map(int,input().split())
V = list(map(int,input().split()))
take_chance = min(N,K)
ans = 0
for A in range(take_chance+1):
    for B in range(take_chance-A+1):
        sum1 = 0
        take = sorted(V[0:A] + V[N-B:N])
        suteru_chance = min(len(take),K-(A+B))
        sum1 = sum(take)
        for i in range(suteru_chance):
            if(take[i]<0):
                sum1 -= take[i]
        ans = max(ans,sum1)
print(ans)

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

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

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

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

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

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

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

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

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

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

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

#[allow(dead_code)]
fn chmin<T>(x: &mut T, y: T) -> bool
where
    T: PartialOrd + Copy,
{
    *x > y && {
        *x = y;
        true
    }
}

#[allow(dead_code)]
fn chmax<T>(x: &mut T, y: T) -> bool
where
    T: PartialOrd + Copy,
{
    *x < y && {
        *x = y;
        true
    }
}

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, VecDeque};

fn main() {
    input! {
        n:usize,
        a:[usize;n]
    }

    let mut ass = a.clone();
    let mut nax = 0;
    for i in 0..n {
        chmax(&mut nax, ass[i]);
    }
    ass.sort();
    for i in 0..n {
        if a[i] == nax {
            println!("{}", ass[n - 2]);
        } else {
            println!("{}", ass[n - 1]);
        }
    }
}


Measured memory_bytes: 9724
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")

#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>

using namespace std;

typedef pair <int, int> pii;
typedef pair <long long, long long> pll;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

#define endl "\n"
#define mt make_tuple
#define mp make_pair

template <typename T1, typename T2>
bool umax(T1 &a, const T2&b) { return a < b ? a = b, 1 : 0;}
template <typename T1, typename T2> 
bool umin(T1 &a, const T2 &b) {return a > b ? a = b, 1 : 0;}
template <typename T>
T sqr(T a) {return a * a;}

mt19937 rng(20010709);
const int mod = 1000000007;
const int INF = 1000000001;

int n, h[100005], dp[100005];

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

    cin >> n;

    for (int i = 1; i <= n; i++)
        cin >> h[i];

    for (int i = 2; i <= n; i++) {
        dp[i] = dp[i - 1] + abs(h[i] - h[i - 1]);

        if (i > 2)
            umin(dp[i], dp[i - 2] + abs(h[i] - h[i - 2]));
    }

    cout << dp[n] << endl;

    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
//解き方を忘れたので解説AC
int main() {
  string s;
  cin>>s;
  int n=s.size();
  vector<int>a(n);
  for(int i=0;i<2;i++){
    int cnt=0;
    for(int j=0;j<n;j++){
      if(s[j]=='R')cnt++;
      else {
        a[j]+=cnt/2;
        a[j-1]+=(cnt+1)/2;
        cnt=0;
      }
    }
    reverse(a.begin(),a.end());
    reverse(s.begin(),s.end());
    for(int i=0;i<n;i++){
      if(s[i]=='L')s[i]='R';
      else s[i]='L';
    }
  }
  for(int i=0;i<n;i++){
    if(i!=n-1)cout<<a[i]<<" ";
    else cout<<a[i]<<endl;
  }
  return 0;
}

    

Measured memory_bytes: 3792
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;

int memo[201][201];
int d, n;
int t[200];
int a[200], b[200], c[200];

int rec(int k, int prev){
	
	if(memo[k][prev] != -1)return memo[k][prev];
	if(k == d)return 0;
	
	int best = 0;
	for(int next = 0; next < n; next++){
		if(t[k] >= a[next] && t[k] <= b[next])
			best = max(best, rec(k + 1, next) + abs(c[next] - c[prev]));
	}
		
	return memo[k][prev] = best;
		
}
int main() {
	for(int i = 0; i <= 200; i++)
		for(int j = 0; j <= 200; j++)
			memo[i][j] = -1;
			
	cin >> d >> n;
	for(int i = 0; i < d; i++)
		cin >> t[i];
	for(int i = 0; i < n; i++)
		cin >> a[i] >> b[i] >> c[i];
		
	int ans = 0;
	for(int i = 0; i < n; i++){
		if(t[0] >= a[i] && t[0] <= b[i])
			ans = max(rec(1, i), ans);
	}

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

Measured memory_bytes: 1324
from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
from heapq import *
from fractions import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 1000010
MOD = 10**9+7
spf = [i for i in range(MAXN)]
spf[0]=spf[1] = -1
def sieve():
    for i in range(2,MAXN,2):
        spf[i] = 2
    for i in range(3,int(MAXN**0.5)+1):
        if spf[i]==i:
            for j in range(i*i,MAXN,i):
                if spf[j]==j:
                    spf[j]=i
def fib(n,m):
    if n == 0:
        return [0, 1]
    else:
        a, b = fib(n // 2)
        c = ((a%m) * ((b%m) * 2 - (a%m)))%m
        d = ((a%m) * (a%m))%m + ((b)%m * (b)%m)%m
        if n % 2 == 0:
            return [c, d]
        else:
            return [d, c + d]
 
def charIN(x= ' '):
    return(sys.stdin.readline().strip().split(x))
 
def arrIN(x = ' '):
    return list(map(int,sys.stdin.readline().strip().split(x)))
 
def ncr(n,r):
    num=den=1
    for i in range(r):
        num = (num*(n-i))%MOD
        den = (den*(i+1))%MOD
 
    return (num*(pow(den,MOD-2,MOD)))%MOD
 
def flush():
    return sys.stdout.flush()
 

'''*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*'''
def dis(p):
    x,y = p
    return (x**2+y**2)**0.5

n,d = arrIN()
a = [arrIN() for i in range(n)]
ans = sum(int(dis(i)<=d) for i in a)
print(ans)

Measured memory_bytes: 148312
#include <iostream>
#include<time.h>
#include<string>
#include<cstring>
#include <cstdio>
#include<utility>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<bitset>
#include<queue>
#include<stack>
#include<set>
#include <limits>
#include <climits>
#include <numeric>
#include<cassert>
#include<cctype>
#include<iterator>
#include<unordered_map>
#include <cassert>
#include <bit>
#include <cstdint>
using namespace std;
typedef long long ll;
typedef unsigned long long LL;
typedef vector<ll>VI;
typedef vector<bool>VB;
typedef pair<ll,ll>P;
typedef pair<double,double>P_D;
#define VV(T) vector<vector<T>>
#define PI 3.1415926535897932384626433832795
#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
#define reprev(i, n) for (ll i = (ll)n - 1; i >= 0; i--)
#define bitrep(bit,A) for(int bit=A; ;bit=(bit-1)&A)
#define ALL(a)  (a).begin(),(a).end()
#define SZ(a) (ll)((a).size())
#define c_max(a, b) (((ll)a)>((ll)b)?(a):(b))
#define c_min(a,b) (((ll)a)<((ll)b)?(a):(b))
#define chmax(x,a) x=c_max(x,a)
#define chmin(x,a) x=c_min(x,a)
#define vmax(v) *max_element(ALL(v))
#define vmin(v) *min_element(ALL(v))
#define SORT(c) stable_sort(ALL(c))
#define $(x) {cout<<#x<<" = " <<(x)<<endl;}
#define fi first
#define se second
#define MAX 100100//5
#define MAX2 200100
#define MAX_6 1001001//6
#define MAX_7 10010010//7
#define SENTINEL 2000000000//9
#define NIL -1
const int MOD = 1000000007;
#define INF 1<<30
#define INFTY 1LL<<61
#define MAX_INT INT_MAX
#define Endl '\n'
#define greater greater<int>()
inline ll GCD(ll a,ll b){return b?GCD(b,a%b):a;}
inline ll lcm(ll a,ll b){return a*b/GCD(a,b);}
using Edge=pair<int,ll>;
using Graph=vector<vector<ll> >;//ll or Edge
using Edge=pair<int,ll>;
//const int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
// g++ -o a a.cpp -Wall -lm -std=c++17
inline ll mod_pow(ll x,ll n,ll mod=(ll)MOD){
    ll res=1;
    while(n>0){
    if(n&1)res=res*x%mod;
    x=x*x%mod;n>>=1;
    }
    return res;
}//x^n%mod
ll nCr(ll n,ll k,ll MOD_=1000000007){
    //assert(n>=0&&k>=0&&MOD_>=2);
    ll size=k;
    ll ans=1;
    vector<ll>fact_inv,inv;
    fact_inv.resize(size+5);
    inv.resize(size+5);
    fact_inv[0]=fact_inv[1]=1;
    inv[1]=1;
    for(int i=2;i<size+5;i++){
        inv[i]=MOD_-inv[MOD_%i]*(MOD_/i)%MOD_;
        fact_inv[i]=fact_inv[i-1]*inv[i]%MOD_;
    }
    for(int i=n;i>=n-k+1;i--){
        ans*=i;ans%=MOD_;
    }
    return ans*fact_inv[k]%MOD_;
}

int main(){
    ll n,a,b;cin>>n>>a>>b;
    ll res=mod_pow(2,n)-1;
    cout<<(res-nCr(n,a)-nCr(n,b)+2*MOD)%MOD<<endl;
}

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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define MOD 1000000007

typedef long long int ll;

const ll INF=(ll)1e18;

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

  int ans=0;
  REP(i,N){
    int h;
    cin >> h;
    if(h>=K)ans++;
  }
  cout << ans << endl;
}



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

int main()
{ 
    int a,b,k;
    cin>>k>>a>>b;
    for(int i=0;i<=b;i=i+k){
        if(i>=a){cout<<"OK"<<endl;return 0;}
    }
    cout<<"NG"<<endl;
    return 0;

}

Measured memory_bytes: 3592
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>

using namespace std;

typedef pair<int, int> P;

int main(){
	
	int t, n;
	
	while(true){
		cin >> t >> n;
		if(t == 0 && n == 0){
			break;
		}
		
		bool visited[200][200] = {};
		
		for(int i = 0; i < n; i++){
			int num1, num2;
			cin >> num1 >> num2;
			visited[num1 + 100][num2 + 100] = true;
		}
		
		int x1, y1;
		cin >> x1 >> y1;
		
		queue<P> que;
		
		P poyo;
		poyo.first = x1;
		poyo.second = y1;
		que.push(poyo);
		
		int ans = 0;
		
		for(int loop = 0; loop <= t; loop++){
			int N = que.size();
			if(N == 0){
				break;
			}
			for(int i = 0; i < N; i++){
				P p = que.front();
				que.pop();
				if(visited[p.first + 100][p.second + 100]){
					continue;
				}
				ans++;
				visited[p.first + 100][p.second + 100] = true;
				P p1 = p;
				p1.second++;
				que.push(p1);
				p1 = p;
				p1.second--;
				que.push(p1);
				p1 = p;
				p1.first++;
				que.push(p1);
				p1 = p;
				p1.first--;
				que.push(p1);
				p1 = p;
				p1.first--;
				p1.second--;
				que.push(p1);
				p1 = p;
				p1.first++;
				p1.second++;
				que.push(p1);
			}
		}
		
		cout << ans << endl;
		
	}
	return 0;
}

Measured memory_bytes: 3168
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <fstream>
#include <string>
#include <math.h>
#include <cstdlib>
#include <istream>
#include <sstream>
#include <cctype>
#define fore(i,x,y) for(long long i=x;i<y;i++)
typedef long long ll;
using namespace std;
int main()
{
	int a,b,c;
	set<int> st;
	cin >> a >> b >> c;
	st.insert(a);
	st.insert(b);
	st.insert(c);
	cout << st.size() << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <stack>
#include <iomanip>
#include <numeric>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <queue>
#include <cmath>

#define BEGIN(x) x.begin()
#define END(x) x.end()
#define ALL(x) BEGIN(x), END(x)
#define PAIR make_pair
#define VEC(type) vector<type >
#define endl '\n'

#define FOR(i, A, B) for(auto i = (A);i != (B); i++)
#define FORD(i, A, B) for(auto i = (A);i != (B); i--)

#define READRANGE(begin, end) FOR(it, begin, end) cin >> *it
#define READVEC(V) READRANGE(BEGIN(V), END(V))

using namespace std;

typedef long long lint;
typedef pair<int, int> Pii;
typedef pair<int, lint> Pil;
typedef pair<lint, lint> Pll;
typedef pair<lint, int> Pli;

// ---- BEGIN LIBRARY CODE ----
// ---- END LIBRARY CODE ----
void io_init()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
};

int main(int argc, char **argv)
{
    io_init();

    // Actual program code starts here.
    int P;
    cin >> P;
    VEC(int) A(P);
    READVEC(A);

    VEC(VEC(int)) Inverse(P, VEC(int)(P));
    FOR(i, 1, P)
        FOR(j, 1, P)
            Inverse[(i * j) % P][i] = j;

    function<vector<int>(vector<int>, int)> PolyF = [&]
        (VEC(int) f, int offset) {
        int N = f.size();
        if (N == 1)
            return VEC(int) {f[0]};

        int b0 = f[0];
        VEC(int) g;
        for (int d = 1;d < N; d++) {
            int coeff = f[d] % P == b0 % P ? 0 
                : Inverse[(P + f[d] - b0) % P][d];
            g.push_back(coeff);
        }

        VEC(int) polyG = PolyF(g, offset + 1);
        VEC(int) Ret(N);
        FOR(i, 0, N - 1) {
            Ret[i + 1] += polyG[i];
            Ret[i + 1] %= P;

            Ret[i] += (P - offset) * polyG[i] % P;
            Ret[i] %= P;
        }

        Ret[0] = (Ret[0] + b0) % P;
        return Ret;
    };

    VEC(int) ret = PolyF(A, 0);
    FOR(i, 0, P)
        cout << ret[i] << " ";
    cout << endl;
    return 0;
};


Measured memory_bytes: 77952
#include <bits/stdc++.h>
using namespace std;
void init_ios() {ios_base::sync_with_stdio(false); cin.tie(nullptr);}

int N, M;
int x[100000], y[100000];

int n[100000], r[100000];

int main() {
	scanf("%d%d", &N, &M);
	for (int i = 0; i < M; ++i) scanf("%d%d", x+i, y+i), --x[i], --y[i];

	for (int i = 0; i < N; ++i) ++n[i];
	r[0] = 1;

	for (int i = 0; i < M; ++i) {
		int xi = x[i], yi = y[i];
		int re = r[xi];
		--n[xi];
		if (!n[xi]) r[xi] = 0;
		++n[yi];
		r[yi] = max(r[yi], re);
	}

	printf("%d\n", accumulate(r, r+N, 0));

	return 0;
}


Measured memory_bytes: 1792
#include <stdio.h>
#include <math.h>
#include <utility>

using namespace std;
typedef pair<double, double> Point;

int n;

const double cos60 = cos( M_PI / 3.0 );
const double sin60 = sin( M_PI / 3.0 );

void solve( int i, Point p0, Point p1 );



int main()
{
    Point p0, p1;
    p0.first  = 0.0;
    p0.second = 0.0;
    p1.first  = 100.0;
    p1.second = 0.0;

    scanf("%d", &n);

    printf("%.10lf %.10lf\n", 0.0, 0.0);

    solve( 0, p0, p1 );

    return 0;
}




void solve( int i, Point p0, Point p1 )
{
    if ( i == n ) {
	printf("%.10lf %.10lf\n", p1.first, p1.second);
    }
    else {
	Point np0, np1, np2;
	double vx = p1.first - p0.first;
	double vy = p1.second - p0.second;
	double ex = vx / 3.0;
	double ey = vy / 3.0;
	np0.first   = p0.first  + ex;
	np0.second  = p0.second + ey;
	np1.first   = np0.first  + cos60 * ex - sin60 * ey;
	np1.second  = np0.second + sin60 * ex + cos60 * ey;
	np2.first   = p0.first  + 2.0 * ex;
	np2.second  = p0.second + 2.0 * ey;
	solve( i + 1, p0,  np0 );
	solve( i + 1, np0, np1 );
	solve( i + 1, np1, np2 );
	solve( i + 1, np2, p1 );
    }
}

Measured memory_bytes: 1068
#include <bits/stdc++.h>
        using namespace std;
        #define int long long
const int MAX = 510000;
const int MOD = 1000000007;

        signed main() {
        int a,b;
        cin>>a>>b;
        int x=0,y=0,p=a,q=b;

        for(int i=0;i<b;i++){
            x+=p;
            p*=10;
        }
        for(int i=0;i<a;i++){
            y+=q;
            q*=10;
        }
        if(a<b)cout<<x;
        else cout<<y;
         return 0;

        }


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

#define INF 1000000007
#define ll long long
#define F first
#define S second
#define pii pair<ll int,ll int>
#define pb push_back
#define ppb pop_back
#define vi vector<ll int>


int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t=1;
	//cin >> t;
	while(t--){
		float c;
		cin >> c;
		float V;
		V = c*c*c;
		V /= 27;
		printf("%0.6f",V);
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <bitset>
#include <vector>
#include <queue>
#include <map>
#include <set>

#define i64 int64_t
#define ff(ii,nn,mm) for(int ii=nn;ii<mm;ii++)
#define st(vvv) sort(vvv.begin(),vvv.end())
#define rvs(vvv) reverse(vvv.begin(),vvv.end())
int inf = 1000000007;
i64 giant = 4000000000000000000;

using namespace std;

int main() {
	int n;
	cin >> n;
	int as = 0;
	vector<int> ans(n + 1,0);//ボール有無
	vector<int> data(n + 1);//a

	ff(i, 1, n + 1)cin >> data[i];//a input

	for (int i = n; i > 0; i--) {
		int s = 0;
		for (int j = i; j <= n; j += i) {
			s += ans[j];
		}
		if (s % 2 != data[i]) {
			ans[i]=1;
			as++;
		}
	}

	cout << as << endl;

	ff(i, 1, n + 1) {
		if (ans[i])cout << i << " ";
	}

	return 0;
}

Measured memory_bytes: 2432
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	ll n;vector<ll>a;
	cin>>n;
	for(ll i=0;i<n;i++){
		ll x;
		cin>>x;
		a.push_back(x);
	}
	sort(a.begin(),a.end());reverse(a.begin(),a.end());
	ll sum=0;
	if(n%2==0){
		ll m=n/2;
		for(ll i=0;i<n;i++){
			if(i==m-1){
				sum+=a[i];
			}
			else if(i==m){
				sum-=a[i];
			}
			else if(i<m-1){
				sum+=2*a[i];
			}
			else{
				sum-=2*a[i];
			}
		}
	}
	else{
		ll m=n/2;
		for(ll i=0;i<n;i++){
			if(i==m){
				sum+=a[i];
			}
			else if(i==m-1){
				sum+=a[i];
			}
			else if(i<m-1){
				sum+=2*a[i];
			}
			else {
				sum-=2*a[i];
			}
		}
		//cout << sum<<endl;
		ll sum2=0;
		for(ll i=0;i<n;i++){
			if(i==m){
				sum2-=a[i];
			}
			else if(i==m+1){
				sum2-=a[i];
			}
			else if(i<m){
				sum2+=2*a[i];
			}
			else{
				sum2-=2*a[i];
			}
		}
		//cout<<sum2<<endl;
		sum=max(sum2,sum);
	}
	cout <<sum;
	// your code goes here
	return 0;
}

Measured memory_bytes: 1400
////////
#include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <complex>
#include <iomanip>
using namespace std;
typedef long long LL;
void guan() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); }
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define ls (rt<<1)
#define rs (rt<<1|1)
#define F first
#define S second
#define mst(x,a) memset(x,a,sizeof(x))
#define Pr pair<int,int>
#define Prl pair<LL, LL>
#define Prd pair<double, double>
#define root 1,cnum,1
#define For(i,b,c) for(int i=b;i<=c;i++)
#define lowbit(x) (x&(-x))
const int maxn = 200020;
const LL mod = 998244353;
const LL mod2 = mod - 1;
const int INF = 0x7FFFFFFF;
const LL LINF = 0x7FFFFFFFFFFFFFFF;
const double pi = acos(-1.0);
const LL maxx = 1LL<<61;
const double eps = 1e-8;
//*********
 
int n, m, q, k, G;
char s[maxn];
inline int read() { return
    cin >> n >> G
?1:0; }

Pr inf[111];

void solve() {
    for(int i = 0;i < n;i++) cin >> inf[i].F >> inf[i].S;
    int ans = INF;
    for(int i = 0;i < (1<<n);i++) {
        //cout << i << endl;
        int sum = 0, num = 0;
        for(int j = 0;j < n;j++) {
            //cout << j << endl;
            if(i&(1<<j)) {
                sum += inf[j].F * (j + 1) * 100 + inf[j].S;
                num += inf[j].F;
            }
        }//cout << sum << " " << num << endl;
        for(int j = n - 1;j >= 0;j--) {
            if(sum >= G) break;
            if(!(i&(1<<j))) {
                if((inf[j].F - 1) * 100 * (j + 1) + sum >= G) {
                    num += (G - sum) / 100 / (j + 1);
                    sum += (G - sum) / 100 / (j + 1) * 100 * (j + 1);
                    if(sum < G) sum += 100 * (j + 1), num++;
                }
                else sum += (inf[j].F - 1) * 100 * (j + 1), num += inf[j].F - 1;
            }
        }
        //cout << i << " " << sum << " " << num << endl;
        if(sum >= G) ans = min(ans, num);
    }
    cout << ans << endl;
}

int main() {
    guan();
    int t = 1;
    //cin >> t;
    int Cas = 1;
    while(t--) {
        while(read())
            //cout << "Case #" << Cas++ << ": " << endl;
            solve();
    }
    //cin >> t;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(void){
   int a,b,c,d;
   cin >> a >> b;
   cin >> c >> d;
   switch(a){
         case 2:
            if(b == 28){
                  cout << 1 << endl;
            }else{
                  cout << 0 << endl;
            }
            break;
         case 4:
         case 6:
         case 9:
         case 11:
            if(b == 30){
                  cout << 1 << endl;
            }else{
                  cout << 0 << endl;
            }
         break;
         default:
            if(b == 31){
                  cout << 1 << endl;
            }else{
                  cout << 0 << endl;
            }
         break;
   }
}


Measured memory_bytes: 3588
import java.util.*;

public class Main {


    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int time_1 = 100000;
        int time_2 = 4;

        int D = sc.nextInt();
        int[] c = new int[27];
        int[] t = new int[D + 1];
        int[] last_day = new int[27];
        Arrays.fill(last_day, 0);
        int[][] s = new int[D + 1][27];
        for (int i = 1; i <= 26; i++) {
            c[i] = sc.nextInt();
        }
        for (int i = 1; i <= D; i++) {
            for (int j = 1; j <= 26; j++) {
                s[i][j] = sc.nextInt();
            }
        }

        for (int i = 1; i <= D; i++) {
            Random random = new Random();
            t[i] = 1 + random.nextInt(26);
        }
        int[] last_array = t;

        long last_sum = 0;
        for (int j = 0; j < time_1; j++) {
            long tmp_sum = 0;
            Arrays.fill(last_day,0);
            for (int k = 0; k < time_2; k++) {
                Random random = new Random();
                int d = 1 + random.nextInt(D);
                int q = 1 + random.nextInt(D);
                int r = 1+ random.nextInt(D);
                int tmp = t[d];
                t[d] = t[q];
                t[q] = tmp;
                t[r] = 1 + random.nextInt(26);
            }
            for (int i = 1; i <= D; i++) {
                last_day[t[i]] = i;
                tmp_sum += calcS(c, s, t[i], i, last_day);
            }
            if (tmp_sum > last_sum) {
                last_array = t;
                last_sum = tmp_sum;
            } else {
                t = last_array;
            }
        }


        for (int i = 1; i <= D; i++) {
            System.out.println(t[i]);
        }

    }

    private static long calcS(int[] c, int[][] s, int kaisai, int day, int[] last_day) {

        long loss = 0;
        for (int i = 1; i <= 26; i++) {
            if (i == kaisai) {
                last_day[i] = day;
                continue;
            }
            loss -= c[i] * (day - last_day[i]);
        }

        long plus = s[day][kaisai];
        return plus + loss;
    }

}


Measured memory_bytes: 47132
N=str(input())
A=N[len(N)-1]
if A =="2" or A =="4" or A =="5" or A =="7" or A =="9":
    print("hon")
elif A=="0" or A=="1" or A=="6" or A=="8":
    print("pon")
elif A=="3":
    print("bon")

Measured memory_bytes: 61776
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace cf
{
    class Program
    {
        static void Main(string[] args)
        {
            int H, W;
            string[] s = Console.ReadLine().Split(' ');
            H = int.Parse(s[0]);
            W = int.Parse(s[1]);

            string str;
            int[] alp = new int[26];
            for (int i = 0; i < H; i++)
            {
                str = Console.ReadLine();
                for (int j = 0; j < W; j++)
                {
                    alp[str[j] - 'a'] += 1;
                }
            }

            int h = H / 2;
            int w = W / 2;

            int quate = h * w;
            int p, qt = 0;
            int odd = 0;
            for (int i = 0; i < 26; i++)
            {
                if (alp[i] == 0) continue;
                p = alp[i] / 4;
                qt += p;
                alp[i] -= p * 4;
                if (quate < qt)
                {
                    alp[i] += (qt + p - quate) * 4;
                }
                if (alp[i] % 2 == 1)
                {
                    odd += 1;
                }
            }

            if(quate > qt)
            {
                Console.WriteLine("No");
            }
            else if (odd > 1)
            {
                Console.WriteLine("No");
            }
            else if (H % 2 == 0 && W % 2 == 0 && odd == 1)
            {
                Console.WriteLine("No");
            }
            else
            {
                Console.WriteLine("Yes");
            }
        }
    }
}


Measured memory_bytes: 13140
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#define _USE_MATH_DEFINES
#include <cmath>
#include <numeric>
#include <iomanip>
#include <deque>
#include <tuple>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <sstream>
#include <stdexcept>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>

#define rep(i, x) for (int i = 0; i < (int)(x); i++)
#define FOR(i, a, done) for (int i = (a); i < (done); ++i)
#define all(a) (a).begin(), (a).end()
#define F first
#define S second
#define x first
#define y second
#define pb push_back
#define pf push_front
#define debug(a) cout << (a) << endl
namespace mp = boost::multiprecision;
using cpp_int = mp::cpp_int;
using ll = long long;
using namespace std;

ll M = 1000000007;

void solve()
{
	int n;
	cin >> n;
	int cnt = 1;
	vector<string> now;
	string s = "";
	rep(i, n) s.push_back('a');
	now.push_back(s);
	int ite[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
	while (cnt < n)
	{
		vector<string> next;

		rep(i, now.size())
		{
			rep(j, ite[cnt])
			{
				string t=now[i];
				t[cnt]+=j;
				next.push_back(t);
			}
		}
		now=next;
		cnt++;
	}
	map<string,int>used;
	vector<string>ans;
	rep(i,now.size()){
		char mc='a';
		rep(j,n){
			if(now[i][j]>mc){
				char prev=now[i][j];
				FOR(k,j,n){
					if(prev==now[i][k]){
						now[i][k]=mc+1;
					}
				}
				mc++;
			}
			
		}
		if(!used[now[i]]){
			ans.push_back(now[i]);
			used[now[i]]++;
		}

	}
	rep(i,ans.size())cout<<ans[i]<<endl;
}

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


Measured memory_bytes: 247520
#include "iostream"
#include "algorithm"
using namespace std;
int main()
{
    int n;
    cin>>n;
    int arr[n];
    
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
        }
    
    sort(arr,arr+n);
    
    for(int i=0;i<n-1;i++)
    {
    if(arr[i]==arr[i+1])
    {
        cout<<"NO"<<endl;
        exit(0);
    }
    
    }
    
    cout<<"YES"<<endl;
    
}


Measured memory_bytes: 1024
import java.util.*;
import java.lang.*;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int cnt = 1;
        int f = 0;
        int[] h = new int[n];
        
        for (int i = 0; i < n; i++) {
            h[i] = sc.nextInt();
        }
        
        for (int i = 1; i < n; i++) {
            boolean look = true;
            for (int j = 0; j < i; j++) {
                if (h[j] > h[i]) {
                    look = false;
                    break;
                }
            }
            if (look == true) {
                cnt++;
            }
        }
        
        System.out.println(cnt);
        
    }
}


Measured memory_bytes: 21844
from itertools import islice

R = lambda: map(int, input().split())
n, m = R()
a = [list(islice(R(), 1, None)) for _ in range(m)]
p = list(R())
r = sum(all(sum(i >> (j - 1) & 1 for  j in r) & 1 == pi
            for r, pi in zip(a, p)) for i in range(1 << n))
print(r)


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main(){
  string S,N,M;
  cin>>S>>N>>M;
  if(S.at(S.size()-1)==N.at(0)&&N.at(N.size()-1)==M.at(0)){
    cout<<"YES"<<endl;
  }else{
    cout<<"NO"<<endl;
  }
}

Measured memory_bytes: 256
#pragma GCC optimize(3,"Ofast","inline")
#pragma GCC target("avx")
#include <bits/stdc++.h>
using namespace std;
#ifdef ONLINE_JUDGE
#define getchar gc
inline char gc(){
	static char buf[1<<16],*p1=buf,*p2=buf;
	if(p1==p2){
		p2=(p1=buf)+fread(buf,1,1<<16,stdin);
		if(p2==p1) return EOF;
	}
	return *p1++;
}
#endif
template<class t> inline t read(t &x){
    char c=getchar();bool f=0;x=0;
    while(!isdigit(c)) f|=c=='-',c=getchar();
    while(isdigit(c)) x=(x<<1)+(x<<3)+(c^48),c=getchar();
    if(f) x=-x;return x;
}
template<class t> inline void write(t x){
    if(x<0) putchar('-'),write(-x);
    else{if(x>9) write(x/10);putchar('0'+x%10);}
}

const double eps=1e-9;
const double pi=acos(-1);


struct point{
	double x,y;
	inline void read(){
		scanf("%lf%lf",&x,&y);
	}
	inline point operator + (const point &nt) const {
		return (point){x+nt.x,y+nt.y};
	}
	inline point operator - (const point &nt) const {
		return (point){x-nt.x,y-nt.y};
	}
	inline point operator * (const double &nt) const {
		return (point){x*nt,y*nt};
	}
	inline double length(){
		return sqrt(x*x+y*y);
	}
};

double distance(point x,point y){ //距离 
	return sqrt((y.x-x.x)*(y.x-x.x)+(y.y-x.y)*(y.y-x.y));
}

struct segment{
	point x,y;
	inline void read(){
		x.read();y.read();
	}
	inline double length(){ //线段长度 
		return distance(x,y);
	}
}x,y;

struct line{
	point x,y;
	inline void read(){
		x.read();y.read();
	}
};

double DJ(point x,point y){ //点积 
	return x.x*y.x+x.y*y.y;
}

double CJ(point x,point y){ //叉积 
	return x.x*y.y-x.y*y.x;
}


point trpoint(segment x){ //将有向线段转成向量点 
	return x.y-x.x;
}

point trpoint(line x){ //将直线转成向量点 
	return x.y-x.x;
}

double prolen(point x,segment a){ //点在有向线段上的投影长度 
	return DJ(trpoint((segment){a.x,x}),trpoint(a))/a.length();
}

point propoint(point x,segment a){ //点在直线上的投影点 
	return a.x+trpoint(a)*(prolen(x,a)/a.length());
}

point refpoint(point x,segment a){ //点在直线上的投影点 
	return x+(propoint(x,a)-x)*2;
}

bool orthline(line x,line y){ //两条直线是否垂直 
	return DJ(trpoint(x),trpoint(y))==0;
}

bool paraline(line x,line y){ //两条直线是否平行 
	return CJ(trpoint(x),trpoint(y))==0;
}

bool interseg(segment x,segment y){ //两条线段是否相交 
	return min(x.x.x,x.y.x)<=max(y.x.x,y.y.x)&&min(y.x.x,y.y.x)<=max(x.x.x,x.y.x)&&min(x.x.y,x.y.y)<=max(y.x.y,y.y.y)&&min(y.x.y,y.y.y)<=max(x.x.y,x.y.y)&&CJ(y.x-x.x,y.y-x.x)*CJ(y.x-x.y,y.y-x.y)<=0&&CJ(x.x-y.x,x.y-y.x)*CJ(x.x-y.y,x.y-y.y)<=0;
}

void doit(){
	x.read();y.read();
	write(interseg(x,y));puts("");
}

signed main(){
	int t;
	read(t);
	while(t--) doit();
}


Measured memory_bytes: 3244
#include<bits/stdc++.h>
using namespace std;
//#include<boost/multiprecision/cpp_int.hpp>
//using boost::multiprecision::cpp_int;

#define int long long
#define cint cpp_int
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPR(i,a,n) for(int i=a;i>n;--i)
#define RUP(a,b) (((a)+(b)-1)/(b))
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define INF LLONG_MAX/2
#define PI acos(-1.0)

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<Pii> VPii;
typedef vector<string> Vs;
typedef priority_queue<int> PQi;

template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
void vout(Vi &v){for(int i=0;i<(v).size();i++) cout<<v[i]<<" ";cout<<endl;}
void vout(Vs &v){for(int i=0;i<(v).size();i++) cout<<v[i]<<" ";cout<<endl;}
void vvout(VVi &v){for(int i=0;i<(v).size();i++) vout(v[i]);}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a,b)*b;}
int mypow(int x, int n, int m){if(n==0)return 1;if(n%2==0)return mypow(x*x%m,n/2,m);else return x*mypow(x,n-1,m)%m;}
int digit(int k,int i){string s = to_string(k);return s[s.size()-i]-'0';}
void uniq(Vi &v){sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end());} //vectorの同じ要素消す
int ctoi(char c){if(c>='0'&&c<='9'){return c-'0';}return 0;}
int leng(int n){string s=to_string(n); return s.size();} //intの桁数
int digitsum(int n){int ret=0; while(n>0){ret+=n%10;n/=10;}return ret;} //桁和
int lesscount(int x,Vi &a){return lower_bound(a.begin(),a.end(),x)-a.begin();} //vector aにおけるx未満の数の個数
int orlesscount(int x,Vi &a){return upper_bound(a.begin(),a.end(),x)-a.begin();} //vector aにおけるx以下の数の個数
int morecount(int x,Vi &a){return a.size()-orlesscount(x,a);} //vector aにおけるxより大きい数の個数
int ormorecount(int x,Vi &a){return a.size()-lesscount(x,a);} //vector aにおけるx以上の数の個数
int count(int x,Vi &a) {return upper_bound(ALL(a),x)-lower_bound(ALL(a),x);} //vector aにおけるxの個数
Vi accum(Vi &v){Vi ret((v).size()+1);REP(i,0,(v).size()) ret[i+1]=ret[i]+v[i];return ret;}
bool comp(Pii a,Pii b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}

signed main(){cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);
    string s;
    cin>>s;
    int n=s.size();

    map<char,int> ma;
    REP(i,0,n){
        ma[s[i]]++;
    }
    int ans=1+n*(n-1)/2;
    for(auto x : ma){
        ans -= x.second*(x.second-1)/2;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 720
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;

constexpr long long int MOD = 1000000007;
//constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-9;

//int N, M, K, H, W, L, R;
long long int N, M, K, H, W, L, R;

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

	cin >> N;
	N %= 10;
	string ans[10];
	ans[0] = ans[1] = ans[6] = ans[8] = "pon";
	ans[3] = "bon";
	ans[2] = ans[4] = ans[5] = ans[7] = ans[9] = "hon";
	cout << ans[N] << endl;
}

Measured memory_bytes: 3644