akhauriyash/Code-Regression huggingface dataset:
n=int(input())
a=list(map(int,input().split()))
from collections import Counter
plus=[0]*n
minus=[0]*n
for i in range(n):
    plus[i]=a[i]+1
    minus[i]=a[i]-1
plus=plus+minus+a
data=Counter(plus)
ans=[]
for i in data.values():
    ans.append(i)
print(max(ans))


Measured memory_bytes: 29512
#include <iostream>
#include <cstdio>
#include <limits.h>

using namespace std;

#define SENTINEL INT_MAX

long long int cnt = 0;
int s[200000];


void merge(int A[], int left, int mid, int right)
{
	int n1 = mid - left;
	int n2 = right - mid;

	int *L = new int[n1 + 1];
	int *R = new int[n2 + 1];


	for (int i = 0; i < n1; i++) {
		L[i] = A[left + i];
	}

	for (int i = 0; i < n2; i++) {
		R[i] = A[mid + i];
	}

	L[n1] = R[n2] = SENTINEL;

	int i = 0;
	int j = 0;

	for (int k = left; k < right; k++) {
		if (L[i] <= R[j]) {
			A[k] = L[i];
			i++;
		}
		else {
			A[k] = R[j];
			cnt += n1 - i;
			j++;
		}
	}

	delete[] R;
	delete[] L;

}

void mergeSort(int A[], int left, int right)
{
	if (left + 1 < right) {
		int mid = (right + left) / 2;
		mergeSort(A, left, mid);
		mergeSort(A, mid, right);
		merge(A, left, mid, right);
	}
}

int main(void)
{
	
	int n;

	
	cin >> n;
	

	
	for (int i = 0; i < n; i++) {
		cin >> s[i];
	}
	
	/*/???????????°??¨
	for (int i = 1; i <= 10000; i++) {
		cnt = 0;
		for (int j = 0; j < 10000; j++) {
			s[j] = 0;
		}
		for (int j = 0; j < i; j++) {
			s[j] = i - j;
		}
		mergeSort(s,0,i);
		if (cnt == (1 + i) / 2.0 * i) {
			cout << "i = " << i <<"OK" << endl;
		}
		else {
			cout << "i = " << i << "OUT" << endl;
		}

	}
	*/

	
	mergeSort(s, 0, n);

	cout << cnt << endl;
	

	return 0;

}

Measured memory_bytes: 4280
// -*- coding:utf-8-unix -*-

use proconio::{fastout, input};
use std::cmp::Reverse;
use std::collections::BTreeSet;

#[fastout]
fn main() {
    input! {
        h: usize,
        w: usize,
        m: usize,
        hw: [(usize, usize); m],
    }
    let mut yokoretsu_nums: Vec<(u64, usize)> = vec![(0, 0); h];
    for i in 1..=h {
        yokoretsu_nums[i - 1].1 = i;
    }
    let mut tateretsu_nums: Vec<(u64, usize)> = vec![(0, 0); w];
    for j in 1..=w {
        tateretsu_nums[j - 1].1 = j;
    }
    let mut objects = BTreeSet::new();
    for &(hi, wi) in &hw {
        yokoretsu_nums[hi - 1].0 += 1;
        tateretsu_nums[wi - 1].0 += 1;
        objects.insert((hi, wi));
    }
    yokoretsu_nums.sort_unstable_by_key(|&(num, _i)| Reverse(num));
    let yokonummax = yokoretsu_nums[0].0;
    tateretsu_nums.sort_unstable_by_key(|&(num, _j)| Reverse(num));
    let tatenummax = tateretsu_nums[0].0;
    for i in 1..=h {
        if yokoretsu_nums[i - 1].0 < yokonummax {
            break;
        }
        let hh = yokoretsu_nums[i - 1].1;
        for j in 1..=w {
            if tateretsu_nums[j - 1].0 < tatenummax {
                break;
            }
            let ww = tateretsu_nums[j - 1].1;
            if !objects.contains(&(hh, ww)) {
                println!("{}", yokonummax + tatenummax);
                return;
            }
        }
    }
    println!("{}", yokonummax + tatenummax - 1);
    return;
}


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

int main(void)
{
int data[7] = {0};
int n;
int d;

while (1){

memset(data, 0, sizeof(data));
scanf("%d", &n);
if (n == 0){
	break;
}

for (int i = 0; i < n; i++){
 scanf("%d", &d);

 if (d >= 60){
 data[6]++;
 }
 else {
  data[d / 10]++;
 }
}

for (int i = 0; i < 7; i++){
 printf("%d\n", data[i]);
}

}
return (0);
}

Measured memory_bytes: 760
global h, w, dat
h, w = map(int, input().split())
dat = []
for i in range(h):
    dat.append(input())
for y in range(h):
    for x in range(w):
        c = 0
        if dat[y][x] == "#":
            print("#", end="")
            continue

        if 0 < y:
            if dat[y - 1][x] == "#":  # 2
                c += 1
            if 0 < x:
                if dat[y - 1][x - 1] == "#":  # 1
                    c += 1
            if w - 1 > x:
                if dat[y - 1][x + 1] == "#":  # 3
                    c += 1
        if 0 < x:
            if dat[y][x - 1] == "#":  # 4
                c += 1
            if y < h - 1:
                if dat[y + 1][x - 1] == "#":  # 7
                    c += 1

        if x < w - 1:
            if dat[y][x + 1] == "#":  # 6
                c += 1
            if y < h - 1:
                if dat[y + 1][x + 1] == "#":  # 9
                    c += 1

        if y < h - 1:
            if dat[y + 1][x] == "#":  # 8
                c += 1
        print(c, end="")
    print("")

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

using namespace std;
using ll = long long;
constexpr int mod = 1e9+7;
constexpr int md = mod;
vector<ll> ret;

int main(){
    ll x,y,z,k;
    cin>>x>>y>>z>>k;
    vector<ll> a(x),b(y),c(z);
    for(auto & tmp:a)cin>>tmp;
    for(auto & tmp:b)cin>>tmp;
    for(auto & tmp:c)cin>>tmp;
    sort(a.rbegin(),a.rend());
    sort(b.rbegin(),b.rend());
    sort(c.rbegin(),c.rend());
    vector<ll> v;
        for(int i=0;i<x;++i){
            for(int j=0;j<y;++j){
                for(int l=0;l<z;++l){
                    if((i+1) * (j+1) * (l+1) <= k)v.push_back(a[i] + b[j] + c[l]);
                    else break;
                }
            }
        }
    sort(v.rbegin(),v.rend());
    for(int i=0;i<k;++i)cout << v[i] <<endl;
    return 0;
}



Measured memory_bytes: 1404
#include <bits/stdc++.h>
#define int long long
#define mod (int)(1e9+7)
#define inf (int)(3e18+7)
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(v) v.begin(),v.end()
#define mkp make_pair
#define mkt make_tuple
#define prique(T) priority_queue<T,vector<T>,greater<T>>
#define vecunique(vec) sort(vec.begin(), vec.end());decltype(vec)::iterator result = std::unique(vec.begin(), vec.end());vec.erase(result, vec.end())
using namespace std;

bool prime(int x) {
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0)return false;
	}
	return x > 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % mod;
		}
		x = x * x % mod;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2) % mod;
}
/*--------Library Zone!--------*/

int n, a[114514], l;
signed main() {
	cin >> n >> l;
	rep(i, n)cin >> a[i];
	int memo;
	rep(i, n - 1) {
		if (a[i] + a[i + 1] >= l) {
			memo = i;
			goto ok;
		}
	}
	cout << "Impossible" << endl;
	return 0;
ok:;
	cout << "Possible" << endl;
	rep(i, memo)cout << i + 1 << endl;
	for (int i = n - 2; i > memo; i--)cout << i + 1 << endl;
	cout << memo + 1 << endl;
}

Measured memory_bytes: 1664
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
static const double EPS = 1e-5;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)

int main(void){
  int n;
  while(cin>>n){
    if(n==0) break;
    vector<PII> data;
    REP(i,n){
      int num,sum = 0;
      cin>>num;
      REP(j,4){
        int m,s;
        cin>>m>>s;
        sum += m*60 + s;
      }
      data.push_back(PII(sum,num));
    }
    sort(data.begin(),data.end());
    cout<<data[0].second<<endl;
    cout<<data[1].second<<endl;
    cout<<data[n-2].second<<endl;
  }
  return 0;
}

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

using namespace std;

long long dp[10001][2][100];

const int mod = 1e9 + 7;

int main()
{
	string k;
	int d;
	cin >> k >> d;
	int size = k.size();
	dp[0][0][0] = 1;
	for (int i = 0; i < size; i++)
		for (int j = 0; j < 2; j++)
			for (int l = 0; l < d; l++)
				for (int n = 0; n <= (j == 0 ? k[i] - '0' : 9); n++)
					dp[i + 1][j || (n < k[i] - '0')][(l + n) % d] = (dp[i + 1][j || (n < k[i] - '0')][(l + n) % d] + dp[i][j][l]) % mod;
	cout << (-1<dp[size][0][0] + dp[size][1][0] - 1?dp[size][0][0] + dp[size][1][0] - 1:mod-1) % mod << endl;

	return 0;
}


Measured memory_bytes: 15872
#include <iostream>

using namespace std;

int calcDebtByWeek(int);

int main(void){
	for(int n; cin >> n; cout << calcDebtByWeek(n) << endl);

	return 0;
}

int calcDebtByWeek(int n){
	int currentDebt = (int)1e5;

	while(n --){
		currentDebt = int(currentDebt * 1.05);

		if(currentDebt % 1000) {currentDebt /= 1000; currentDebt ++; currentDebt *= 1000; }
	}	
	return currentDebt;
}

Measured memory_bytes: 1160
import itertools

DIM = int(input())
args = [int(input()) for a in range(DIM)]
temp = list(map(lambda x:x%10, args))
if sum(temp) == 0:
    print(0)
    exit()
i = DIM
while(i>0):
    comb = list(itertools.combinations(args, i))
    combMax = list(map(sum, comb))
    for c in sorted(combMax, reverse=True):
        if c%10==0:
            continue
        else:
            print(c)
            exit()
    i = i -1
print(0)
exit()

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

const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;

int main() {
  int n ,p;
  cin >> n >> p ;
  vector<int>a(n);
  rep(i,n) cin>>a[i];
  
  int sum=0;
  rep(i,n){
    if(a[i]%2==1) sum++;
  }
  ll ans=pow(2,n);
  if(sum==0 && p==0) cout<<ans;
  if(sum==0 && p==1) cout<<0;
  if(sum!=0) cout<<ans/2;
  return 0;
}


Measured memory_bytes: 4044
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;

#define rep(i, n) for (int i = 0; i < n; ++i)
#pragma region Debug
template <typename T>
void view(const std::vector<T> &v)
{
    for (const auto &e : v)
    {
        std::cout << e << " ";
    }
    std::cout << std::endl;
}
template <typename T>
void view(const std::vector<std::vector<T>> &vv)
{
    for (const auto &v : vv)
    {
        view(v);
    }
}
#pragma endregion
#pragma region chminmax
template <typename T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}
template <typename T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}
#pragma endregion

int main()
{
    int q;
    cin >> q;
    rep(d, q)
    {
        string s, t;
        cin >> s >> t;
        vector<vector<int>> dp(s.size() + 1, vector<int>(t.size() + 1));

        rep(i, s.size()) rep(j, t.size())
        {

            chmax(dp[i + 1][j + 1], dp[i][j] + (s[i] == t[j]));
            chmax(dp[i + 1][j + 1], dp[i + 1][j]);
            chmax(dp[i + 1][j + 1], dp[i][j + 1]);
        }
        cout << dp[s.size()][t.size()] << endl;
    }
    return 0;
}


Measured memory_bytes: 6772
from bisect import bisect_left
N=int(input())
triangle=[]
count=0
L=list(map(int,input().split()))
L.sort()
#print(L)
for a in range(N):
    for b in range(a+1,N):
        c=L[a]+L[b]
        zahyo=bisect_left(L,c)
        count+=max(0,zahyo-b-1)
print(count)


Measured memory_bytes: 43372
#include<iostream>
#include<cstdio>
#include<algorithm>

using namespace std;

int ans, n, a[101], money[101],t;

int main() {
	cin >> n;
	ans = 1e7;
	for (int i = 0; i < n; ++i)
		scanf("%d", &a[i]);
	for(int i=0;i<n-1;++i)
		for (int j = 0; j < n - 1 - i; ++j) {
			if (a[j] > a[j + 1]) {
				int t = a[j];
				a[j] = a[j + 1];
				a[j + 1] = t;
			}
		}
	for (int i = a[0]; i <=a[n - 1]; ++i) {
		for (int j = 0; j < n; ++j)
			money[t] += (i - a[j]) * (i - a[j]);
		t++;
	}
	for (int i = 0; i < t; ++i)
		ans = min(ans, money[i]);
	cout << ans << endl;
	return 0;
}


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

using namespace std;

#define int long long
long long m, s, ans = 1e12;

long long f(long long b, long long n){
    if(b == 1) return 0;
    if(n < b) return n;
    else return f(b, n / b) + n % b;
}

signed main(){
    cin.tie(0), ios::sync_with_stdio(0);
    cin >> m >> s;
    if(m == s){
        cout << m + 1;
        return 0;
    }
    for(int i = 2; i*i <= m; i++){
        if(f(i, m) == s)
            ans = min (ans,i);
    }
    for(int i = 2; i*i <= s; i++){
        if(f(i, m) == s)
            ans = min (ans,i);
    }
    if(m > s){
        for(int i = 1; i*i <= m - s; i++){
            int pointer = (m - s)/i + 1;
            if(f(i, m) == s)
                ans = min(ans,i);
            if(f(pointer, m) == s)
                ans = min(ans,pointer);
        }
    }
    if(ans != 1e12) {cout << ans; exit(0);}
    cout << "-1\n";
}


Measured memory_bytes: 384
#define _USE_MATH_DEFINES
#include<iostream>
#include<fstream>
#include<string>
#include<vector>
#include<utility>
#include<algorithm>
#include<climits>
#include<set>
#include<map>
#include<cmath>
#include<iomanip>
#include<iterator>
#include<queue>
#include<stack>
#include<cctype>
#include<deque>
#include<time.h>
#include<bitset>
#include<random>
#include<unordered_set>
#include<unordered_map>
#include<sstream>
#include<random>
#include<numeric>
#include<memory.h>
//by Skeef79

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:16777216")
#define pb push_back
#define en '\n'
#define for0(i,n) for(int i = 0;i<n;i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define vec vector
#define pii pair<int,int>
#define pll pair<ll,ll>
#define what_is(x) cout<<#x<<" is "<<x<<en;

using namespace std;

const int INF = 2000000000;
const ll LINF = 2000000000000000000;

template<typename T> void print(vector<T>& a)
{
	for (int i = 0; i < a.size(); i++)
		cout << a[i] << ' ';
	cout << en;
}

template<typename T> void print(deque<T>& a)
{
	for (int i = 0; i < a.size(); i++)
		cout << a[i] << ' ';
	cout << en;
}

template<typename T> void print(vector<vector<T>>& a)
{
	for (int i = 0; i < a.size(); i++)
	{
		for (int j = 0; j < a[i].size(); j++)
			cout << a[i][j] << ' ';
		cout << en;
	}
}

template <typename T> void input(vector<T>& a)
{
	for (int i = 0; i < a.size(); i++)
		cin >> a[i];
}

template<typename T> void input(deque<T>& a)
{
	for (int i = 0; i < a.size(); i++)
		cin >> a[i];
}

template<typename T> void input(vector<vector<T>>& a)
{
	for (int i = 0; i < a.size(); i++)
		for (int j = 0; j < a[i].size(); j++)
			cin >> a[i][j];
}


void solve()
{
	ll a, b;
	cin >> a >> b;
	cout << a * b;

}

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

#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
#endif

	int tst = 1;
	//cin >> tst;
	while (tst--)
		solve();
}

Measured memory_bytes: 3612
import sys
def input(): return sys.stdin.readline().rstrip()

class UnionFind:
    def __init__(self, n):
        self.parents = [-1] * (n + 1)

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
    
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def same(self, x, y):
        return self.find(x) == self.find(y)
    
def main():
    N, M = map(int, input().split())
    P = tuple(map(int, input().split()))
    un = UnionFind(N)
    for _ in range(M):
        x, y = map(int, input().split())
        un.union(x, y)
    ans = 0
    for i, p in enumerate(P):
        if un.same(i + 1, p):
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()


Measured memory_bytes: 14580
n = int(input())
a = []

r = int(input())
g = 0
m = 1000000001
s = False
d = -1000000001
for i in range(1, n):
    m = min(m, r)
    r_save = r
    r = int(input())
    if r == r_save:
        s = True
        continue
    g_save = g
    if r > r_save:
        g = 1
    elif r < r_save:
        if not s and not a:
            d = max(d, r - r_save)
        g = -1
    if g_save == 1 and g == -1:
        a.append((r_save, m))
    if i == n - 1 and g == 1:
        a.append((r, m))

if not a:
    if s:
        print(0)
    else:
        print(d)
else:
    print(max([v[0] - v[1] for v in a]))



Measured memory_bytes: 15212
function Main(input){
	input = input.trim();
	return /^A[a-z]+C[a-z]+$/.test(input)?"AC":"WA";
}

// If you are interested in the algorithms I used, 
// there is no need to read down from this line.

((b,c,d)=>"undefined"!=typeof require?console.log(Main(require("fs").readFileSync("/dev/stdin","utf8"))):[b=b.split("\n").slice(1,-1).join("\n"),c=function(){try{return Main(b)}catch(f){return f.stack||f.message}}(),d=typeof c,"string"==d||(c=JSON.stringify(c)),$("<form>").append([[10,b],0,[1,d],0,[10,c]].map(f=>$(f?"<textarea>":"<br>",f&&{rows:f[0],cols:40,text:f[1]}))).appendTo("body")])(`
AcycliCe
`);

Measured memory_bytes: 7496
#include <cstdio>
#include <iostream>
#include <array>
#include <vector>
#include <algorithm>
#include <functional>
#include <tuple>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <utility>
#include <memory>
#include <valarray>
#include <climits>

using namespace std;

using ll = long long int;

#define loop(i, N) for (int i = 0; i < N; ++i)
#define scanInt(x) int x; scanf("%d", &x); getchar();
#define scanLLInt(x) ll x; scanf("%lld", &x); getchar();
#define scanVecInt(A, N) vector<int> A(N); loop(i, N){scanf("%d", &(A[i])); getchar();}
#define scanVecLLInt(A, N) vector<ll> A(N); loop(i, N){scanf("%lld", &(A[i])); getchar();}

int main()
{
    scanInt(N);
    scanLLInt(A);
    scanLLInt(B);
    const ll C = A - B;
    scanVecLLInt(H, N);
    ll mmin = LLONG_MAX;
    ll mmax = 0;
    loop(i, N){
        mmin = min(H[i] / A + ((H[i] % A > 0) ? 1 : 0), mmin);
        mmax = max(H[i] / B + ((H[i] % B > 0) ? 1 : 0), mmax);
    }
    auto judge = [&](ll m){
        ll m2 = 0;
        loop(i, N){
            const ll rest = H[i] - B * m;
            if (rest > 0){
                m2 += rest / C + ((rest % C > 0) ? 1 : 0);
                if (m < m2) break;
            }
        }
        return (m2 <= m);
    };
    while (mmin + 1 < mmax){
        // printf("%lld %lld\n", mmin, mmax);
        const ll m = (mmax + mmin) / 2;
        if (judge(m)){
            mmax = m;
        }else{
            mmin = m;
        }
    }
    printf("%lld\n", mmax);
}


Measured memory_bytes: 1024
/*
 * main.c
 *
 *  Created on: 2019/02/21
 *      Author: family
 */


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int data[100] = {0};

int main()
{
	int n, m;
	int val, val2, ans;
	int temp;
	scanf("%d %d", &n, &m);
	val = m/n;
	val2 = val + (m%n);

	if (val == val2) {
		ans = val;
	} else {
		temp = val;
		while(temp > 0) {
			if (m%temp == 0) {
				ans = temp;
				break;
			} else {
				temp--;
			}
		}
	}

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


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

bool isT(string &sd, string &t, int idx) {
  if (idx + t.size() - 1 >= sd.size()) return false;

  for (int i = 0; i < t.size(); i++) {
    if (sd.at(i + idx) != t.at(i) && sd.at(i + idx) != '?') {
      return false;
    }
  }

  return true;
}

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

  string sd, t;
  cin >> sd >> t;

  string ans = "";

  vector<int> tis;

  for (int i = 0; i < sd.size(); i++) {
    if (isT(sd, t, i)) {
      tis.push_back(i);
    }
  }

  if (tis.empty()) {
    ans = "UNRESTORABLE";
  } else {
    for (int i = 0; i < tis.size(); i++) {
      string cp = sd;
      int ti = tis.at(i);

      for (int j = 0; j < t.size(); j++) {
        cp.at(ti + j) = t.at(j);
      }

      for (int j = 0; j < cp.size(); j++) {
        if (cp.at(j) == '?') cp.at(j) = 'a';
      }

      if (ans == "") {
        ans = cp;
      } else {
        ans = ans > cp ? cp : ans;
      }
    }
  }

  cout << ans << endl;

  return 0;
}

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

int main() {
  char N;
  // string N_str;
  // cin >> N;
  for (int i = 0; i < 3; i++) {
    cin >> N;
    if (N == '7') {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}


Measured memory_bytes: 3620
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <map>
#include <iomanip>	
#include <deque>
#include <set>
#define rep(i,a,b) for(int i=a;i<b;++i)
#define rrep(i,a,b) for(int i=a;i>=b;--i)
#define fore(i,a) for(auto &i:a)
#define INF INT_MAX/2;
typedef long long ll;
using namespace std;
using vi = vector<int>;
using vll = vector<ll>;
ll mod = 1e9 + 7;
//ll llmax = 10000000000000000000ll;
using namespace std;
using Graph = vector<vector<int>>;


int cnt_digit(ll N)
{
	int digit = 0;

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


 // 最大公約数計算
 
ll gcd(ll a, ll b)
{
	if (b == 0) {
		return a;
	}
	else {
		return gcd(b, a % b);
	}
}
// 最小公倍数の計算

ll lcm(ll a, ll b)
{
	ll g = gcd(a, b);

	return a / g * b;
}

struct union_find
{
	vector<int> par, r;
	union_find(int n)
	{
		par.resize(n);
		r.resize(n);
		init(n);
	}


	void init(int n)
	{
		for (int i = 0; i < n; i++) par[i] = i;
		for (int i = 0; i < n; i++) r[i] = 0;
	}

	int find(int x)
	{
		if (par[x] == x)return x;
		else return find(par[x]);
	}

	void unite(int x, int y)
	{
		x = find(x);
		y = find(y);

		if (r[x] < r[y])
		{
			par[x] = y;
		}
		else
		{
			par[y] = x;
			if (r[x] == r[y])
			{
				r[x]++;
			}
		}
	}
};



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

	cin >> a;

	vector<pair<int,int>> r(a);
	vector<pair<int,int>> b(a);
	
	rep(i, 0, a) {
		int c, d;

		cin >> c >> d;
		r[i] = make_pair(d, c);
	}

	rep(j, 0, a) {
		int c, d;

		cin >> c >> d;
		b[j] = make_pair(c, d);
	}
	sort(r.begin(), r.end(), greater < pair<int, int>>());

	sort(b.begin(), b.end());

	
	
	int ans = 0;
	vector<bool> C(a);
	rep(i, 0, a) {
		rep(j, 0, a) {
			if (C[j])continue;
			if (r[j].second < b[i].first && r[j].first < b[i].second) {
				C[j] = true;
				ans++;
				break;
			}

		}
	}
	
	

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

Measured memory_bytes: 256
import java.util.*;

public class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();

    if (n < 1200) {
      System.out.println("ABC");
    } else if (n < 2800) {
      System.out.println("ARC");
    } else {
      System.out.println("AGC");
    }
  }
}


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

using namespace std;
using ll = long long;



int main()
{
    int n;
    cin >> n;
    bool res = false;
    for(int i = 0; i < n; i++){
        char t; cin >> t;
        if(t == 'Y')res = true;
    }
    cout << (res ? "Four" : "Three") << endl;
}

Measured memory_bytes: 256
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet, BinaryHeap};
#[allow(unused_imports)]
use std::iter::FromIterator;

mod util {
    use std::io::stdin;
    use std::str::FromStr;
    use std::fmt::Debug;

    #[allow(dead_code)]
    pub fn line() -> String {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.trim().to_string()
    }

    #[allow(dead_code)]
    pub fn get<T: FromStr>() -> T
    where
        <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.trim().parse().unwrap()
    }

    #[allow(dead_code)]
    pub fn gets<T: FromStr>() -> Vec<T>
    where
        <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.split_whitespace()
            .map(|t| t.parse().unwrap())
            .collect()
    }

    #[allow(dead_code)]
    pub fn get2<T: FromStr, U: FromStr>() -> (T, U)
    where
        <T as FromStr>::Err: Debug,
        <U as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        let mut iter = line.split_whitespace();
        (
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
        )
    }

    #[allow(dead_code)]
    pub fn get3<S: FromStr, T: FromStr, U: FromStr>() -> (S, T, U)
    where
        <S as FromStr>::Err: Debug,
        <T as FromStr>::Err: Debug,
        <U as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        let mut iter = line.split_whitespace();
        (
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
        )
    }
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn main() {
    let a: Vec<char> = util::line().chars().collect();
    let n = a.len();
    let mut count = HashMap::new();

    for &c in &a {
        *count.entry(c).or_insert(0) += 1;
    }

    let ans = 1 + n * (n - 1) / 2 - count.values().map(|&c| c * (c - 1) / 2).sum::<usize>();

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


Measured memory_bytes: 4352
program subarray_sum
  implicit none
  integer :: n, k, s, i, l = 1
  read(*,*) n, k, s
  if (s < 10**9) l = s+1
  do i = 1, k
    write(*,'(i0)') s
  end do
  do i = k+1, n
    write(*,'(i0)') l
  end do
end program subarray_sum

Measured memory_bytes: 1280
//リストにある素数の個数を求める
#include<iostream>
#include<cmath>
using namespace std;

bool isPrime(int N)
{
    if ( N == 2)
    {
        return true;
    }

    if (N < 2 || ( N > 2 &&N % 2 == 0 ))
    {
        return false;
    }
    
    for (int i = 2; i <= sqrt(N); i++)
    {
        if(N % i == 0)
        {
            return false;
        }
    }
    return true;
}

int main()
{
    int N, n, count;
    count = 0;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> N;
        if (isPrime(N))
        {
            count++;
        }
    }
    cout << count << endl;
    return 0;
}



Measured memory_bytes: 3104
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)

using namespace std;
typedef long long ll;

int n;
int vs[200000+10];
int nextPos[200000+10];
int lastOccur[200000+10];

int memo[200000+10];
int solve(int pos) { // そこからの時の、実際の始まりの位置を返す
  int& res = memo[pos];
  if(res < 0) {
    if(pos == n) {
      res = n;
    } else {
      if(nextPos[pos] < 0) {
        res = pos;
      } else {
        res = solve(nextPos[pos]+1);
      }
    }
  }
  return res;
}

int main(void) {
  ll k;
  scanf("%d%lld", &n, &k);
  REP(i, n) {
    scanf("%d", &vs[i]);
  }
  memset(nextPos, -1, sizeof nextPos);
  memset(lastOccur, -1, sizeof lastOccur);
  for(int i = n-1; i >= 0; --i) {
    int v = vs[i];
    nextPos[i] = lastOccur[v];
    lastOccur[v] = i;
  }
  memset(memo, -1, sizeof memo);

  vector<int> period(1, n);
  for(int start = 0; ; ) {
    // cerr << ">" << start << endl;
    int tmp = solve(start);
    if(tmp == n) {
      break;
    }
    period.push_back(tmp);
    start = lastOccur[vs[tmp]]+1;
  }
  // REP(i, period.size()) {
  //   cerr << period[i] << ",";
  // }
  // cerr << endl;

  int idx = period[k % period.size()];
  vector<int> res;
  for(;;) {
    int tmp = solve(idx);
    if(tmp == n) {
      break;
    }
    res.push_back(vs[tmp]);
    idx = tmp+1;
  }

  REP(i, res.size()) {
    printf("%d%s", res[i], i == (int)res.size()-1 ? "" : " ");
  }
  puts("");
  
  return 0;
}


Measured memory_bytes: 6388
#include <stdio.h>
#define N 100001
int n;
int A[N];
int num[N];
char B[N];
int Partition(int, int);
void Quick_Sort(int, int);
int main(){
    int i;
    int p;
    int tmp=1;
    int r;
    scanf("%d\n", &n);
    for( i=0; i<n; i++ ){
        scanf("%c %d\n", &B[i],&A[i]);
        num[i]=i+1;
    }
    p=0;
    r=n-1;
    Quick_Sort(p, r);
    for( i=1; i<n; i++ ){
        if( A[i] == A[i-1] && num[i] < num[i-1] ){
            tmp = 0;
            break;
        }
    }
    if( tmp == 1 )printf("Stable\n");
    else if( tmp == 0 ) printf("Not stable\n");
    for( i=0; i<n; i++ ) printf("%c %d\n",B[i], A[i]);
    return 0;
}
int Partition(int p, int r){
    int i;
    int j;
    int tmp1;
    int tmp3;
    char tmp2;
    int x;
    x=A[r];
    i=p-1;
    for( j=p; j<=r-1; j++ ){
        if( A[j] <= x ){
            i++;
            tmp1=A[j];
            A[j]=A[i];
            A[i]=tmp1;
 
            tmp2=B[j];
            B[j]=B[i];
            B[i]=tmp2;
 
            tmp3 = num[j];
            num[j]=num[i];
            num[i]=tmp3;
        }
    }
    tmp1=A[r];
    A[r]=A[i+1];
    A[i+1]=tmp1;
 
    tmp2=B[r];
    B[r]=B[i+1];
    B[i+1]=tmp2;
 
    tmp3=num[r];
    num[r]=num[i+1];
    num[i+1]=tmp3;
    return i+1;
}
void Quick_Sort(int p, int r){
    int q;
    if( p < r ){
        q = Partition(p,r);
        Quick_Sort(p, q-1);
        Quick_Sort(q+1, r);
    }
}

Measured memory_bytes: 1484
#include<bits/stdc++.h>            //  IT'S NEVER TOO LATE...
    	using namespace std;
        #include<math.h>
    	#define ll long long
    	#define fore(i, l, r) for(int i = int(l); i < int(r); ++i)
        #define forn(i, n) fore(i, 0, n)
        #define fori(i, l, r) fore(i, l, (r) + 1)
        #define sz(v) int((v).size())
        #define all(v) (v).begin(), (v).end()
        #define pb push_back
        #define mp make_pair
        #define ff first
        #define ss second

        const double PI = atan(1)*4;

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

    	
    	vector<int> ar[1000001];
        vector<pair<int,int>> path;
        int vis[1000001],dis[1000001];

        /*void dfs(int node)
        {
            vis[node]=1;

            for(int child : ar[node])
            {
                if(vis[child]==0)
                {
                    dis[child]=dis[node]+1;
                    dfs(child);
                }
            }
        }*/

    /*    void bfs(int i)
        {
            queue<int> q;
            q.push(i);
            vis[i]=1;
            dis[i]=0;

            while(!q.empty())
            {
                int curr=q.front();
                q.pop();

                for(int child : ar[curr])
                    if(vis[child]==0)
                    {
                        q.push(child);
                        dis[child]=dis[curr]+1;
                        vis[child]=1;
                    }
            }
        }*/

        bool isprime(int n)
        {
            for(int i=2;i*i<=n;i++)
                if(n%i==0)
                    return false;
            return true;
        }

        bool comp(pair<int,int> a, pair<int,int> b)
        {
            return b.ff < a.ff ;
        }

        int modpow(int b,int p,int m)
        {
            if(p==0) return 1%m;
            if(p%2) return (b*modpow(b,p-1,m))%m;
            int u=modpow(b,p/2,m);
            return (u*u)%m;
        }

        int c[55] , dp[300];

        int fn(int n,int m)
        {
            //cout<<n<<" ";
            if(n==0)
                return 1;

            if(dp[n])
                return dp[n];
            int ans = 0;

            forn(i,m)
            {
                //cout<<c[i]<<"\n";
                if(c[i]<=n)
                ans+=fn(n-c[i] , m);
            }
            dp[n]=ans;
            return ans;
        }

    	int main()  
    	{

    		
    		int t=1;
    		//cin>>t;
    		
    		while(t--)
    		{
                int n,m;
                cin>>n>>m;

                cout<<n*m;
            }
            return 0;
    	}

        //              NOW IT'S TIME TO WAKE UP...

Measured memory_bytes: 27076
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<map>
#include<queue>
#include<utility>
#include<set>
using namespace std;
using ll = long long;

int main(){ 
    int n,m,k;
    int ans=0;
    int s[11][11]={},p[11]={};
    cin >> n >> m;
    for(int i=0;i<m;i++){
        cin >> k;
        for(int j=0;j<k;j++){
            cin >> s[i][j];
        }
    }
    for(int i=0;i<m;i++){
        cin >> p[i];
    }
    for (int bit = 0; bit < (1<<n); ++bit) {
        int flag[10]={};
        for (int i = 0; i < n; ++i) {
            if (bit & (1<<i)) { //Niがon
                for(int j=0;j<m;j++){
                    for(int x=0;x<10;x++){
                        if(s[j][x]==i) flag[j]++;
                    }
                }
            }
        }
        bool ok=true;
        for(int j=0;j<m;j++){
            if(p[j]!=flag[j]%2){
                 ok=false;
                 break;
            }
        }
        if(ok) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <map>
#include <vector>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <set>
#include <stack>
#include <queue>

using namespace std;
#define int long long
#define double long double
#define LINF ~(1LL<<63)
#define fst first
#define snd second
#define fr(s,n,i) for(int i=s;i<n;i++)
#define fr_(s,n,i) for(int i=s;i>=n;i--)
#define srt(v) sort(v.begin(), v.end());
#define rev(v) reverse(v.begin(), v.end());
#define upr(v, aim, ind) int ind; ind=(int)distance(v.begin(), upper_bound(v.begin(),v.end(), aim));
#define sz(v) (int)v.size()
#define ers(v, i) v.erase(v.begin() + i)
#define last(v) v[sz(v) - 1]
#define swp(v, i, j) int buf = v[j]; v[j] = v[i]; v[i] = buf;
#define shout(a) cout << a << endl;
#define dshout(a) printf("%.16Lf\n", a);
#define pr pair<int, int>
#define vi vector<int>
#define vp vector<pair<int, int>>
#define vd vector<double>
#define vdd vector<vd>
#define mx(a, b) a = max(a, b);
#define mn(a, b) a = min(a, b);
#define mulM(a,b,c) a = a * b % c;
#define squM(a,b) a = a * a % b;
#define mpr(a,b) make_pair(a,b);
#define iinp(a) int a; cin >> a;
#define sinp(a) string a; cin >> a;
#define dinp(a) double a; cin >> a;
#define ios() ios_base::sync_with_stdio(0);cin.tie(0);

int MOD = 1000000007;

int powM(int base, int exp){
    int ret = 1;
    int buf = base;
    while(exp > 0){
        if(exp & 1){
            ret *= buf;
        }
        squM(buf, MOD)
        exp >>= 1;
    }
    return ret;
}
int combM(int a, int b){
    if(b == 0){
        return 1;
    }
    if(a-b < b){
        return combM(a, a-b);
    }
    int ans = 1;
    fr(1,b+1,i){
        ans *= a + 1 - i;
        ans /= i;
    }
    return ans;
}
void solve();
signed main() {
    ios()
    solve();
    return 0;
}






int cntCost(int left, int right){
  if(right < 0){
    return cntCost(abs(right), abs(left));
  } else if(left >= 0){
    return (right+left)*(right-left+1) / 2;
  } else {
    return cntCost(0, abs(left)) + cntCost(0,right);
  }
}
void solve(){
  iinp(sx)iinp(sy)iinp(tx)iinp(ty)
  cout << 'L';
  fr(0,ty-sy+1,_){
    cout << 'U';
  }
  fr(0,tx-sx+1,_){
    cout << 'R';
  }
  cout << 'D';

  fr(0,tx-sx,_){
    cout << 'L';
  }
  fr(0,ty-sy,_){
    cout << 'D';
  }

  fr(0,tx-sx,_){
    cout << 'R';
  }
  fr(0,ty-sy,_){
    cout << 'U';
  }

  cout<< 'R';
  fr(0,ty-sy+1,_){
    cout << 'D';
  }
  fr(0,tx-sx+1,_){
    cout << 'L';
  }
  cout<< 'U' << endl;
}



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

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int n, x, y;
    cin >> n;
    int count = 0, ans = 0;;
    for(int i = 0; i < n; i++)
    {
        cin >> x >> y;
        if(x == y)
        {
            count++;
        }
        else
            count = 0;
        if(count == 3)
            ans = 1;
    }
    if(ans)
        cout << "Yes";
    else
        cout << "No";
}


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

int main() {
  string A,B,C;cin>>A>>B>>C;
  if(A[A.size()-1] == B[0] && B[B.size()-1] == C[0]) cout << "YES" << endl;
  else cout << "NO" << endl;
}

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

int main(){
  string s,t;
  cin >> s >> t;
  bool flag = false;
  for(int i=0;i<s.size();i++){
      string turn = s.substr(s.size()-1-i,i+1)+s.substr(0,s.size()-1-i);
      if(turn == t){
          flag = true;
          break;
      }
  }
  if(flag) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <iomanip>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

#define DEBUG

#ifdef DEBUG
#define var_dump(...) fprintf(stdout, __VA_ARGS__)
#define dump(a) cout << a << "\n";
#else
#define var_dump(...) 42
#define dump(a) 42
#endif

typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy4[]={0, 0, 1, -1};
int dx4[]={1, -1, 0, 0};
int dx8[]={0, 0, 1, -1, 1, 1, -1, -1};
int dy8[]={1, -1, 0, 0, 1, -1, -1, 1};

// https://beta.atcoder.jp/contests/abc076/tasks/abc076_c

int main() {
    string S, T; cin >> S >> T;

    if (S.size() < T.size()) {
        cout << "UNRESTORABLE" << "\n";
        return 0;
    }

    string ans = "~";
    for (int i = 0; i <= S.size() - T.size(); i++) {
        string sub = S.substr(i, T.size());

        bool can = true;
        for (int j = 0; j < T.size(); j++) {
            if (sub[j] != T[j] && sub[j] != '?') {
                can = false;
            }
        }

        if (can) {
            string U = S;
            for (int j = 0; j < T.size(); j++) {
                U[i+j] = T[j];
            }
            for (int k = 0; k < U.size(); k++) {
                if (U[k] == '?') U[k] = 'a';
            }

            ans = min(U, ans);
        }
    }

    if (ans == "~") {
        cout << "UNRESTORABLE" << "\n";
    } else {
        cout << ans << "\n";
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repI(i, d, n) for (int i = (d); i < (n); ++i)
#define reps1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using M = map<int, int>;
using Ml = map<ll, ll>;
ll const INF = 1ll<<61;
double pi = 3.141592653589793238;

int main() {
  ll n;
  cin >> n;
  vector<string> s(n);
  rep(i, n) cin >> s[i];
  ll c0, c1, c2, c3;
  c0 = 0; c1 = 0; c2 = 0; c3 = 0;

  rep(i, n) {
    if (s[i] == "AC") c0++;
    if (s[i] == "WA") c1++;
    if (s[i] == "TLE") c2++;
    if (s[i] == "RE") c3++;
  }

  cout << "AC x  " << c0 << endl;
  cout << "WA x  " << c1 << endl;
  cout << "TLE x  " << c2 << endl;
  cout << "RE x  " << c3 << endl;

  return 0;
}


Measured memory_bytes: 6376
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using vb = vector<bool>;
using mll = map<ll, ll>;
using sll = stack<ll>;
#define REP(i,n) for(ll i(0);(i)<(n);(i)++)
#define rep(i,n) for(ll i(0);(i)<(n);(i)++)
#define ALL(a) a.begin(), a.end()
#define enld endl //* missspell check
const ll INF = 1LL << 60;


void solve(std::string S){
    if(S.length()==1){
        cout << 1 << endl;
        return;
    }
    string tmps = S.substr(0, 1);
    ll i = 1;
    ll cnt = 1;
    while(i < S.length()){
        if(tmps.length()==1){
            if(S.substr(i, 1)== tmps){
                if( i < S.length()-1){
                    tmps = S.substr(i, 2);
                    cnt++;
                    i+=2;
                }
                else{
                    break;
                }
            }
            else{
                tmps = S.substr(i, 1);
                cnt++;
                i++;
            }
        }
        else{
            tmps = S.substr(i, 1);
            cnt++;
            i++;
        }
    }
    cout << cnt << endl;
}

int main(){
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


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

int main()
{
    //ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);

    long long k, D, N, x, y, count=0;
    cin>>N>>D;
    //T=1;
    while(N--)
    {
        cin>>x>>y;
        long long dis = x*x + y*y;
        if(dis <= D*D) count++;

    }

    cout<<count;
    return 0;
}

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

#define MAX_N 10000

typedef pair<int, int> P;

int n;
vector<P> E[MAX_N];
vector<int> dp[MAX_N];

int height(int v, int e){
    if(dp[v][e] != -1) return dp[v][e];
    int ans = 0, u = E[v][e].first, w = E[v][e].second;
    if(E[u].size() == 1) return dp[v][e] = w;
    for(int i = 0; i < E[u].size(); i++){
        if(E[u][i].first == v) continue;
        ans = max(ans, height(u, i));
    }
    return dp[v][e] = w + ans;
}

int main(){
    cin >> n;
    for(int i = 0; i < n - 1; i++){
        int s, t, w;
        cin >> s >> t >> w;
        E[s].push_back(P(t, w));
        E[t].push_back(P(s, w));
    }
    for(int i = 0; i < n; i++)
        dp[i].resize(E[i].size(), -1);
    for(int i = 0; i < n; i++){
        int H = 0;
        for(int j = 0; j < dp[i].size(); j++)
            H = max(H, height(i, j));
        cout << H << endl;
    }
    
    return 0;
}


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

int main() {
    string S;
    cin >> S;
    int count = 0;
    char now = S.at(0);
    for(int i = 0; i < S.size(); i++) {
        if(S.at(i) != now) {
            now = S.at(i);
            count++;
        }
    }
    cout << count << endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MOD 1e9 + 7

template < typename T >
void printVector (const vector < T > & vec) {
	for (const T x : vec) {
		cout << x << " ";
	}
	cout << endl;
}

template < typename T >
void printMatrix (const vector < vector < T > > & mat) {
	for (const vector < T > vec : mat) {
		printVector (vec);
	}
	cout << endl;
}

const ll INF = 1e18L + 5;

template < typename T >
void min_self (T& a, T b) {
	a = min (a, b);
}

template < typename T >
void max_self (T& a, T b) {
	a = max (a, b);
}

void add_self (int & a, int b) {
	a += b;
	if (a >= MOD) {
		a -= MOD;
	}
}

int main() {
	int h, w;
	scanf ("%d %d", &h, &w);
	vector < string > mat (h);
	for (int i = 0; i < h; i++) {
		cin >> mat[i];
	}
	vector < vector < int > > dp (h, vector < int > (w, 0));
	vector < pair < int, int > > diffs = {{0, 1}, {1, 0}};
	dp[0][0] = 1;
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			for (pair < int, int > diff : diffs) {
				int x = i + diff.first, y = j + diff.second;
				if (x < h && y < w && mat[x][y] == '.') {
					add_self (dp[x][y], dp[i][j]);
				}
			}
		}
	}
	// printMatrix (dp);
	printf ("%d\n", dp[h - 1][w - 1]);
	return 0;
}


Measured memory_bytes: 5248
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
using namespace std;

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


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

int kaibun(string s){
  int n = s.size();
  for(int i = 0; i < n; i++){
    if(s.at(i) != s.at(n-1-i)){
      return 0;
    }
  }
  return 1;
}

int main(){
  string s;
  cin >> s;
  int n = s.size();
  string s1 = s.substr(0, (n-1)/2);
  string s2 = s.substr((n+1)/2);
  if(kaibun(s) && kaibun(s1) && kaibun(s2)){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func intSlice(str string) []int {
	splitted := strings.Split(str, " ")
	ret := make([]int, len(splitted))

	for i, str := range splitted {
		if strings.TrimSpace(str) != "" {
			n, _ := strconv.Atoi(str)
			ret[i] = n
		}
	}

	return ret
}

func main() {

	stdin := bufio.NewScanner(os.Stdin)

	// 一行目
	stdin.Scan()
	line1 := stdin.Text()
	ints1 := intSlice(line1)
	a := ints1[0]
	b := ints1[1]

	if a <= 5 {
		fmt.Println("0")
	} else if a < 13 {
		fmt.Printf("%d\n", b/2)
	} else {
		fmt.Printf("%d\n", b)
	}
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string n;
  cin >> n;
  
  if (n[0] == n[1] && n[1] == n[2]) {
  	cout << "Yes" << endl;
  }else if ( n[1] == n[2] && n[2] == n[3]) {
  	cout << "Yes" << endl;
  }else {
  	cout << "No" << endl;
  }
}

Measured memory_bytes: 256
// Problem : B. Array Walk
// Contest : Codeforces - Educational Codeforces Round 92 (Rated for Div. 2)
// URL : https://codeforces.com/contest/1389/problem/B
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include<bits/stdc++.h>
#define f first
#define s second
#define ll long long
#define vi vector<int>
#define pii pair<int, int>
#define si set<int>
#define y1 yy
#define debug if(printDebug)
using namespace std;
bool printDebug=false;
int main(){
    //printDebug=true;
    /*freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);//*/
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);//*/
    int n;
    cin >> n;
    cout << (n>=30 ? "Yes":"No") << "\n";
    return 0;
}

Measured memory_bytes: 3632
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int X; cin >> X;
    int ans = 0;
    REP(b, 1, 1000) {
        int n = b * b;
        while(n <= X) {
            ans = max(ans, n);
            n *= b;
            if(b == 1) break;
        }
    }
    cout << ans << endl;

    return 0;
}


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

#define YESNO(x) x ? printf("YES") : printf("NO")
#define YesNo(x) x ? printf("Yes") : printf("No")
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define scani(x) scanf("%d", &x)
#define scanll(x) scanf("%lld", &x)
#define printi(x) printf("%d", x)
#define printll(x) printf("%lld", x)
typedef long long ll;
using namespace std;

long long GCD(long long x, long long y) {
	return y ? GCD(y, x % y) : x;
}

long long LCM(long long x, long long y) {
	return x * y / GCD(x, y);
}

int A() {
	int s, w;
	scani(s);
	scani(w);

	if (s <= w) {
		printf("unsafe");
	}
	else {
		printf("safe");
	}

	return 0;
}

int B() {
	int a, b, c, d;
	scani(a);
	scani(b);
	scani(c);
	scani(d);
	bool flg = false;
	while (0 < a && 0 < c) {
		if (flg) {
			a -= d;
		}
		else {
			c -= b;
		}
		flg = !flg;
	}
	YesNo(0 < a);
	return 0;
}

int Main() {
	int n;
	scani(n);
	vector<string> s(n, "\0");
	for (auto& x : s) {
		cin >> x;
	}

	sort(s.begin(), s.end());
	auto result = unique(s.begin(), s.end());
	s.erase(result, s.end());
	printi(s.size());

	return 0;
}

int main()
{
	Main();
	return 0;
}


Measured memory_bytes: 9600