akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
//---------------------------
using namespace std;
//---------------------------
#define REP(i,n) for(int i = 0; i < (n); i++)
// #define P(x) cout << (x) << "\n"

// #define MOD 1000000007 // 1e9+7
// #define PI acos(-1.0)
// #define ll long long int // 10^18
// #define INF 1000000001 // 1e9+1

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

int n,m,a,b;
int main(){
  // std::ios::sync_with_stdio(false);
  // std::cin.tie(0);

  // ifstream in("input.txt");
  // cin.rdbuf(in.rdbuf());
  static bool p[8][8];
  cin>>n>>m;
  for(int i=0; i<m; i++) {cin>>a>>b; a--; b--; p[a][b]=true; p[b][a]=true;}
  int G[8]={0,1,2,3,4,5,6,7};
  int cnt=0;
  do {
    if(G[0]!=0) continue;
    bool OK=true;
    for(int i=1; i<n; i++) {
      if(p[G[i-1]][G[i]]==false) OK=false;
    }
    if(OK==true) cnt++;
  } while(next_permutation(G,G+n));
  cout<<cnt<<endl;
  return 0;
}


Measured memory_bytes: 256
/*
  A - Three-letter acronym
  Contest 059
  Rakesh Kumar --> 28/08/2020
 */

#include <bits/stdc++.h>

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

    std::string a, b, c, s;
    std::getline(std::cin, s);
    std::istringstream iss(s);
    iss >> a >> b >> c;
    std::cout << static_cast<char>(a[0] - 32)
              << static_cast<char>(b[0] - 32)
              << static_cast<char>(c[0] - 32)
              << std::endl;

    return 0;
}


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

#define REP(i, n) for(int i = 0; i < n; ++i)
using namespace std;

int main()
{   
    int n;
    cin >> n;

    vector<int> a(n);
    REP(i, n)   cin >> a[i];
    
    int cnt = 0;
    string judge = "E";

    REP(i, n-1) {
        if (a[i] == a[i+1])     continue;

        if (a[i] < a[i+1]) {

            if (judge == "D") {
                cnt++;
                judge = "E";
            }

            else if (judge == "E") 
                judge = "I";
        }

        if (a[i] > a[i+1]) {

            if (judge == "I") {
                cnt++;
                judge = "E";
            }

            else if (judge == "E") 
                judge = "D";
        }
    }
    cout << cnt + 1 << endl;
}

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

using namespace std;

#define MAX 502
 
int main(){
    int n;
    int v[MAX];
     
    while(cin >> n,n){       
        for(int i = 0 ; i <= n ; i++){
            cin >> v[i];
        }
         
        int d;
        for(int i = 0 ; i <= n ; i++){
            int tmp = v[i],nv[MAX],t = 0,cnt = 0;
            v[i] = 0;
            for(int k = 0 ; k <= n ; k++){
                if(!v[k]) continue;
                nv[t++] = v[k];
            }
             
            for(int j = 1 ; j < n ; j++){
                if(j==1){
                    d = nv[j] - nv[j-1];
                }
                if(d == nv[j]-nv[j-1]) cnt++;
            }
            if(cnt == n-1){
                cout << tmp << endl;
                break;
            }
            v[i] = tmp;
        }
    }
    return 0;
}

Measured memory_bytes: 3064
n, x = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
for i in range(n-1):
    if A[i]+A[i+1]>x:
        ans += A[i+1]+A[i]-x
        A[i+1] = max(0,x-A[i])
print(ans)

Measured memory_bytes: 19968
#include <iostream>
using namespace std;
int dx[] = {0,0,0,3,2,1,0,0,0,-1,-2,-3},dy[] = {3,2,1,0,0,0,-1,-2,-3,0,0,0};

void chain(int sx,int sy,int bom[][8]){
  bom[sx][sy] = 0;
  int x,y; 
  for(int i = 0 ; i < 12 ; i++){
    x = dx[i] + sx;
    y = dy[i] + sy;
    if(bom[x][y] == 1 && (0 <= x && x < 8) && (0 <= y && y < 8 )){
      chain(x,y,bom);
    }
  }

}

int main(){
  string bo;
  int bom[8][8];
  int n,k;
  cin >> n;
  for(k = 1 ; k <= n ; k++ ){
    for(int i = 0 ; i < 8; i++){
      cin >> bo;
       for(int j = 0; j < 8 ; j++){
	bom[i][j] = bo[j] - '0';
      }
    }
 
    int sx,sy;
    cin >> sy >> sx;
    sx--;sy--;
    chain(sx,sy,bom);
    cout << "Data " << k << ":" << endl;
    for(int i = 0; i < 8 ; i++){
      for(int j = 0; j < 8 ; j++){
	cout << bom[i][j];
      }
      cout << endl;
    }
  }
}
//http://www9.plala.or.jp/sgwr-t/c/sec11-2.html
//二次元配列を関数へ渡す場合

Measured memory_bytes: 1200
/*  -*- coding: utf-8 -*-
 *
 * 2889.cc: Internet Protocol Address
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 12;
const int M = 4;

/* typedef */

/* global variables */

char s[MAX_N + 4];
int dp[MAX_N + 1][M + 1];

/* subroutines */

/* main */

int main() {
  scanf("%s", s);
  int n = strlen(s);

  dp[0][0] = 1;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < M; j++)
      if (dp[i][j] > 0) {
	if (s[i] == '0') dp[i + 1][j + 1] += dp[i][j];
	else {
	  int d = 0;
	  for (int k = i; k < n; k++) {
	    d = d * 10 + (s[k] - '0');
	    if (d >= 256) break;
	    dp[k + 1][j + 1] += dp[i][j];
	  }
	}
      }

  printf("%d\n", dp[n][M]);
  return 0;
}



Measured memory_bytes: 3232
#include<bits/stdc++.h>
using namespace std;
long long  gcds(long long  a, long long b)
{
    long long r=0, t=0;
 
    if(a<b){
        t=a;
        a=b;
        b=t;
    }
    while(b!=0){
        r=a%b;
        a=b;
        b=r;
    }
 
    return a;
}        
int main(){
    long long n, i, j, k, ans=0;
    cin >> n;
    for(i=1;i<=n;i++){
        for(j=1;j<=n;j++){
            for(k=1;k<=n;k++){
                ans+=gcds(gcds(i, j), k);

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

Measured memory_bytes: 3600
#include <bits/stdc++.h>
#define ll long long
#define pi 3.14159265358979
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
using namespace std;
const int INF = 1000100100;

long long int mod_pow(long long int x, long long int n, long long int m){
    long long int res = 1;
    while(n > 0){
        if(n & 1) res = res*x%m;
        x = x*x%m;
        n >>= 1;
    }
    return res;
}

int main(){
    ll n,sum=0;
    cin>>n;
        sum=2*mod+mod_pow(10,n,mod)-2*mod_pow(9,n,mod)+mod_pow(8,n,mod);
    	sum%=mod;
    cout<<sum;
}

Measured memory_bytes: 3636
N, M = map(int, input().split())


ans_d = {}

cnt_d = {}

for i in range(N):
    cnt_d[i+1] = 0

for i in range(M):
    p, s = input().split()
    if int(p) in ans_d: continue
    if s == 'AC':
        ans_d[int(p)] = cnt_d[int(p)]
    elif s == 'WA':
        cnt_d[int(p)] += 1


ans = 0
for k, v in ans_d.items():
    ans += v


print('{} {}'.format(len(ans_d), ans))


Measured memory_bytes: 60260
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ll long long 
#define REP(i, a, b) for (ll i = a; i < b; i++)
#define REPI(i, a, b) for (ll i = b - 1; i >= a; i--)
#define i_os ios::sync_with_stdio(0);  cin.tie(0);  cout.tie(0);
#define INF (ll)1e18 + 100
#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl
#define MAX 1e6
/*SOME BITMASK KNOWLEDGE
1)x & (x - 1):sets the last one bit of x to zero
power of two exactly when x & (x − 1) = 0.
2)x & -x:sets all the one bits to zero, except last one bit
3)x | (x - 1):inverts all the bits after the last one bit*/
#define o_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define o_setll tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>
typedef tree<pair<ll, ll>,null_type,less<pair<ll, ll>>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set

int main() 
{ 
	ll n,a,b,c;
	cin>>n>>a>>b>>c;
	vector<char> v;
	string s[n];
	REP(i,0,n){
		cin>>s[i];
	}
	REP(i,0,n){
		if(s[i] == "AB"){
			if(a == 0 && b == 0){
				cout<<"No"<<endl;
				return 0;
			}
			else {
				if(a > b){
					a--;
					b++;
					v.push_back('B');
				}
				else if(a == b){
					if(i+1 < n && s[i+1] == "AC"){
						a++;
						b--;
						v.push_back('A');
					}
					else {
						a--;
						b++;
						v.push_back('B');	
					}
				}
				else {
					a++;
					b--;
					v.push_back('A');
				}
			}
		}
		else if(s[i] == "BC"){
			if(c == 0 && b == 0){
				cout<<"No"<<endl;
				return 0;
			}
			else {
				if(b > c){
					b--;
					c++;
					v.push_back('C');
				}
				else if(c == b){
					if(i+1 < n && s[i+1] == "AB"){
						c--;
						b++;
						v.push_back('B');
					}
					else {
						c++;
						b--;
						v.push_back('C');	
					}
				}
				else {
					c--;
					b++;
					v.push_back('B');
				}
			}
		}
		else if(s[i] == "AC"){
			if(a == 0 && c == 0){
				cout<<"No"<<endl;
				return 0;
			}
			else {
				if(a > c){
					a--;
					c++;
					v.push_back('C');
				}
				else if(a == c){
					if(i+1 < n && s[i+1] == "AB"){
						a++;
						c--;
						v.push_back('A');
					}
					else {
						a--;
						c++;
						v.push_back('C');	
					}
				}
				else {
					a++;
					c--;
					v.push_back('A');
				}
			}
		}
	}
	cout<<"Yes"<<endl;
	REP(i,0,v.size()) cout<<v[i]<<endl;
	return 0;	
}  


Measured memory_bytes: 6880
#define ENABLE_DEBUG 1
// Kana's kitchen {{{
#include<bits/stdc++.h>
#define ALL(v) std::begin(v),std::end(v)
#define LOOP(k) for(i64 ngtkana_is_a_genius=0; ngtkana_is_a_genius<(i64)k; ngtkana_is_a_genius++)

using i32 = std::int_least32_t;
using i64 = std::int_least64_t;
using u32 = std::uint_least32_t;
using u64 = std::uint_least64_t;
using usize = std::size_t;

template <class T> using vec = std::vector<T>;
template <class T> using numr = std::numeric_limits<T>;

#ifdef NGTKANA
#include<debug.hpp>
#else
#define DEBUG(...)(void)0
#endif
/*}}}*/

int main(){
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    std::cout << std::setprecision(15) << std::fixed;

    usize h, w, a, b;
    std::cin >> h >> w >> a >> b;

    for (usize i=0; i<h; i++) {
        for (usize j=0; j<w; j++) {
            std::cout << ((i<b)==(j<a));
        }
        std::cout << '\n';
    }
}


Measured memory_bytes: 1280
#include <iostream>
#include <vector>
#include <stack>
using namespace std;

int main() {
	int N; cin >> N;
	vector<int> p(N) , q(N);
	for (int i = 0; i < N; ++i) cin >> p[i], --p[i], q[p[i]] = i;
	
	string res = "";
	int num = 0;
    stack<int> st;
	for (int i = 0; i < N; ++i) {
        res += "(";
        st.push(i);
        while (!st.empty() && q[st.top()] == num) {
            res += ")";
            ++num;
            st.pop();
        }
	}
	if (st.empty()) cout << res << endl;
	else cout << ":(" << endl;
}



Measured memory_bytes: 4148
#include <stdio.h>
#include <math.h>

int main() {
  int number_x, answer, i = 0;
  scanf("%d", &number_x);
  while(1) {
    i++;
    if(pow(2, i) > number_x) {
      break;
    }
  }
  answer = pow(2, i-1);
  printf("%d\n", answer);
  return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <map>

#ifdef _XCODE_DEBUG
    #include <fstream>
#endif

int main() {
    #ifdef _XCODE_DEBUG
        std::ifstream in("input.txt");
        std::cin.rdbuf(in.rdbuf());
    #endif
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);

    // input data
    int N, chk;
    long long ans = 1;
    bool is_prime_flag;
    std::vector<int> primelist = {2};
    std::map<int, int> mp;
    std::cin >> N;
    for (int i=2; i<=N; ++i) {
        chk = i;
        is_prime_flag = true;
        for (auto x : primelist) {
            while (chk % x == 0) {
                chk /= x;
                ++mp[x];
                is_prime_flag = false;
            }
        }
        if (is_prime_flag) {
            primelist.push_back(i);
            ++mp[i];
        }
    }
    for (auto x : mp) ans = ans * (x.second + 1) % 1000000007;
    std::cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <algorithm>

using namespace std;

int N;
int A[200005], a[200005];;

int main(void)
{
	cin >> N;
	for(int i = 1; i <= N; i++) cin >> A[i];
	for(int i = 1; i <= N; i++){
		a[i] = A[i];
	}
	sort(a+1, a+N+1);
	
	int l = a[N/2], r = a[N/2+1];
	if(l == r){
		for(int i = 1; i <= N; i++){
			cout << l << endl;
		}
		return 0;
	}
	
	for(int i = 1; i <= N; i++){
		if(A[i] <= l) cout << r << endl;
		else cout << l << endl;
	}
	return 0;
}

Measured memory_bytes: 3712
#include <iostream>
#include <vector>
#include <functional>
#include <algorithm>
using namespace std;

int main()
{
    int N;
    cin>>N;
    vector<vector<int>> E(N);
    vector<vector<int>> I(N);
    for (int i=0; i<N-1; i++)
    {
        int a, b;
        cin>>a>>b;
        a--, b--;
        E[a].push_back(b);
        E[b].push_back(a);
        I[a].push_back(i);
        I[b].push_back(i);
    }

    int K = 0;
    vector<int> ans(N-1);
    function<void(int, int, int)> f = [&](int v, int p, int c)
    {
        int t = 0;
        for (int i=0; i<(int)E[v].size(); i++)
        if (E[v][i]!=p)
        {
            t++;
            if (t==c)
                t++;
            ans[I[v][i]] = t;
            f(E[v][i], v, t);
        }
        K = max(K, t);
    };
    f(0, -1, -1);

    cout<<K<<endl;
    for (int a: ans)
        cout<<a<<endl;
}


Measured memory_bytes: 12032
N = int(input())
A = list(map(int,input().split()))

def round(x,d=0):
    p = 10**d
    return (x*p*2+1)//2/p

mean = round(sum(A)/N)

ans = 0
for a in A:
    ans += (a - mean) ** 2
print(int(ans))

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define DAU  ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define PLEC exit(0);
using namespace std;
int n;
string s;
int main() {
    DAU
    cin >> n >> s;
    if (n & 1) {
        cout << "No";
        PLEC
    }
    s = '$' + s;
    for (int i = 1; i <= n / 2; ++i)
        if (s[i] != s[i + n / 2]) {
            cout << "No";
            PLEC
        }
    cout << "Yes";
    PLEC
}


Measured memory_bytes: 3624
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

A, B = nl()

count = 0
for i in range(A, B+1):
    S = str(i)
    if S == S[::-1]:
        count += 1
print(count)


Measured memory_bytes: 3060
import sys
input = sys.stdin.readline
h,w = map(int,input().split())
s = [[j for j in input()] for i in range(h)]
d_2y = [[0] * w for i in range(h)]
d_2t = [[0] * w for i in range(h)]
d_2w = [[0] * w for i in range(h)]
for i in range(h):
  c = 0
  for j in range(w):
    if s[i][j] == '#':
      c = 0
    else:
      c += 1
    d_2y[i][j] = c
for i in range(h):
  for j in range(w-2,-1,-1):
    if s[i][j] == '#':
      continue
    else:
      d_2y[i][j] = max(d_2y[i][j+1],d_2y[i][j])
for i in range(w):
  c = 0
  for j in range(h):
    if s[j][i] == '#':
      c = 0
    else:
      c += 1
    d_2t[j][i] = c
for i in range(w):
  for j in range(h-2,-1,-1):
    if s[j][i] == '#':
      d_2t[j][i] = 0
    else:
      d_2t[j][i] = max(d_2t[j][i],d_2t[j+1][i])
m = 0
for i in range(h):
  for j in range(w):
    d_2w[i][j] = d_2y[i][j] + d_2t[i][j]
  m = max(m,max(d_2w[i]))
print(m-1)

Measured memory_bytes: 279432
import java.util.Arrays;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long[] a = new long[3 * n];

    for (int i = 0; i < (3 * n); i++) {
      a[i] = sc.nextLong();
    }

    Arrays.sort(a);
    long sum = 0;

    for (int i = (3 * n) - 2; i >= n; i -= 2) {
      sum += a[i];
    }

    System.out.println(sum);

  }
}

Measured memory_bytes: 61364
#include <bits/stdc++.h>
#define int long long
using namespace std;
int sum;
signed main(){
	int n;
	cin>>n;
	vector<int>vec(n);
	for(int i=0;i<n;i++){
		cin>>vec[i];
	}
	sort(vec.begin(),vec.end());
	reverse(vec.begin(),vec.end());
	for(int i=1;i<n;i++){
		sum+=vec[i];
	}
	if(sum>vec[0]){
		cout<<"Yes"<<endl;
	}
	else{
		cout<<"No"<<endl;
	}
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");

		int n = Integer.parseInt(str[0]);
		int k = Integer.parseInt(str[1]);

		Set<Integer> set = new HashSet<>();
		for (int i = 0; i < k; i++) {
			int d = Integer.parseInt(br.readLine());
			str = br.readLine().split(" ");
			for (int j = 0; j < d; j++) {
				int a = Integer.parseInt(str[j]);
				set.add(a);
			}
		}

		System.out.println(n - set.size());
	}
}


Measured memory_bytes: 33780
#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <string>
#include <sstream>
#include <algorithm>
#include <random>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <cassert>
#include <climits>
#include <bitset>
#include <functional>
#include <iomanip>
#include <random>

#define FOR_LT(i, beg, end) for (int i = (int)(beg); i < (int)(end); i++)
#define FOR_LE(i, beg, end) for (int i = (int)(beg); i <= (int)(end); i++)
#define FOR_DW(i, beg, end) for (int i = (int)(beg); (int)(end) <= i; i--)
#define REP(n)              for (int repeat_index = 0; repeat_index < (int)n; repeat_index++)


using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout << fixed << setprecision(20);

	int n, m; cin >> n >> m;
	vector<int64_t> hs(n + 1);
	FOR_LT(i, 0, n) {
		cin >> hs[i + 1];
	}

	vector<vector<int>> rs(n + 1);
	FOR_LT(i, 0, m) {
		int a, b; cin >> a >> b;
		rs[a].push_back(b);
		rs[b].push_back(a);
	}

	int ans = 0;
	FOR_LE(i, 1, n) {
		bool is_ok = true;
		int64_t ch = hs[i];
		for (auto& v : rs[i]) {
			if (hs[v] >= ch) {
				is_ok = false;
				break;
			}
		}
		if (is_ok) ans++;
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 9268
from collections import Counter

N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
count = Counter(A)
win = ["Yes" if K >= Q + 1 else "No"] * N
for a, n in count.items():
    win[a - 1] = "Yes" if n >= Q - K + 1 else "No"
print("\n".join(win))

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

const int MAXN = 2e5 + 10, MAXA = 1e6 + 6, SQRT = 447;
int a, b, c;
int ans;

int main() {
    cin >> a >> b >> c;
    ans = abs(a - b) + abs(a - c);
    ans = min(ans, abs(b - a) + abs(b - c));
    ans = min(ans, abs(c - a) + abs(c - b));
    cout << ans;
}

Measured memory_bytes: 256
n,k=map(int,input().split())
a=list(map(int,input().split()))

l=0
r=1e9+5

while l+1!=r:
    m = (l+r)//2
    cnt = 0
    for x in a:
        cnt += (x-1)//m
    if cnt <= k:
        r = m
    else:
        l = m
print(int(r))

Measured memory_bytes: 94096
#include <iostream>

using namespace std;

int main() {
    int N, T, n, t;
    int ans = 1001;
    cin >> N >> T;

    for (int i = 0; i < N; i++) {
        cin >> n >> t;
        if (n < ans && t <= T) {
            ans = n;
        }
    }

    if (ans == 1001) {
        cout << "TLE" << endl;
    } else {
        cout << ans << endl;
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); 
#define pi 3.1415926535897
#define ll long long int
#define ld long double
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define mod 1000000007
#define mod1 998244353
#define inf 1000000000000000000
#define inf1 100000000000000
#define endl '\n'

int main()
{
	fastio;
	#ifdef gdb_18
		freopen("input.txt" , "rt" ,stdin);
		freopen("output.txt" , "wt" ,stdout);
	#endif
	ll n,d;
	cin>>n>>d;
	ll ans=0;
	for(ll i=1;i<=n;i++)
	{
		ll a,b;
		cin>>a>>b;
		if((a*a+b*b)<=(d*d))
			ans++;
	}
	cout<<ans<<endl;
	return 0;	
}

Measured memory_bytes: 3644
#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;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
};


int main() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  sort(a.begin(), a.end());

  combination c(n+5);

  mint ans = 0;
  rep(ri,2) {
    rep(i,n) {
      mint now = c(i,k-1);
      if (ri == 1) now = -now;
      ans += now*a[i];
    }
    reverse(a.begin(), a.end());
  }

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


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

int main(){
    int n = 0;
    int limit;
    scanf("%d",&n);
    printf("%d:",n);
    limit = sqrt(n) ;
    for(int i = 2;i <= n ;){
        if(n%i == 0){
        printf(" %d",i);
         n /=i;
        }
        else i++;
        
        if(i > limit) {printf(" %d",n);break;}
    }
    putchar('\n');
    
    return 0;
}


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



int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll N, X, T;
    cin >> N >> X >> T;
    ll ans = ((N + (X - 1))/ X) * T;
    cout << ans << endl;
    return 0;
}

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

int main(){
  int N, A, B;
  long ans=0;
  cin >> N >> A >> B;
  for(int i=1; i<=N; i++){
    int sum =0;
    sum += i%10;
    sum += (i/10)%10;
    sum += (i/100)%10;
    sum += (i/1000)%10;
    sum += (i/10000)%10;
    if(A<=sum && sum <=B) ans+=i;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <queue>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(10)

using namespace std;

// 多重配列
template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
    return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
    for(auto &e:t) fill_v(e,v);
}

typedef pair<int, int> P;

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

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

    int H, W;
    cin >> H >> W;
    auto memo = make_v<int>(H, W);
    fill_v(memo, -1);

    queue<P> q;
    REP(i, H) REP(j, W) {
        char a;
        cin >> a;
        if (a != '#') continue;
        memo[i][j] = 0;
        q.push({i, j});
    }

    int res = 0;
    while (!q.empty()) {
        auto p = q.front();
        q.pop();
        REP(i, 4) {
            int nx = p.first + dx[i];
            int ny = p.second + dy[i];
            if (nx < 0 || ny < 0 || nx >= H || ny >= W) continue;
            if (memo[nx][ny] >= 0) continue;
            memo[nx][ny] = memo[p.first][p.second] + 1;
            res = max(memo[nx][ny], res);
            q.push({nx, ny});
        }
    }
    cout << res << endl;

    return 0;
}


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


int main()
{
	int w,h,x,y,r;
	cin >> w >> h >> x >> y >> r;
	if ((x - r) >= 0 && (y - r) >= 0 && (x + r) <= w && (y + r) <= h)
	{
		cout << "Yes\n";
	}
	else {cout << "No\n";}
    return 0;
}



Measured memory_bytes: 3080
import sys
input=lambda: sys.stdin.readline().rstrip()
n=10**5
is_prime=[True]*(n+1)
is_prime[0]=False
is_prime[1]=False
for i in range(2,int(n**0.5)+1):
  if not is_prime[i]:
    continue
  for j in range(i*2,n+1,i):
    is_prime[j]=False
A=[0]*n
def f(x):
  return is_prime[x] and is_prime[(x+1)//2]

for i in range(3,n,2):
  if f(i):
    A[i]=A[i-2]+1
  else:
    A[i]=A[i-2]
A=[0]+A
q=int(input())
for _ in range(q):
  l,r=map(int,input().split())
  print(A[r+1]-A[l-1])


Measured memory_bytes: 5476
#include<bits/stdc++.h>
#define ll                 long long int
#define mod                1000000007
#define pi                 3.14159265358979323846264338327950288419716939937510
#define setbit(x)          __builtin_popcountll(x)
#define db                 double
#define pp(x)              pair<x,x>
#define ff                 first
#define ss                 second
#define FIO                ios_base::sync_with_stdio(false); cin.tie(NULL);
#define tc                 ll tc; cin>>tc; for(ll number = 1 ; number <= tc ; number ++ )
#define vv(x)              vector<x>
#define pb                 push_back
#define pob                pop_back
#define pf                 push_front
#define pof                pop_front
#define endl               "\n"
#define pq                 priority_queue
#define dbg(x)             { cout<< #x << ": " << (x) << endl; }
#define dbg2(x,y)          { cout<< #x << ": " << (x) << " , " << #y << ": " << (y) << endl; }
#define bp                 ll kkk; cin >>kkk;
#define dbgArr(a,n)        cout<<"Array "<<#a<<endl; for(ll i=0 ; i<n ; i++) cout<<a[i]<<" "; cout<<endl;
#define maxE(a,n)          *max_element(a,a+n);
#define minE(a,n)          *min_element(a,a+n);
#define forn(i,s,n)        for(ll i=s ; i<n ; i++)
#define fornr(i,e,s)       for(ll i=e-1 ; i>=s ; i--)
#define arr(a,n)           for(ll i=0;i<n;i++){ cin>>a[i]; }
#define arr1(a,n)          for(ll i=1;i<=n;i++){ cin>>a[i]; }
#define file freopen("input.txt","r",stdin); freopen("output.txt","w",stdout)
#define print cout<<"Case #"<<number<<": "
#define all(x) x.begin(), x.end()
ll power(ll x, ll b) {ll p = 1;while (b > 0) {if(b&1) {p = p * x; p %= mod;} b >>= 1; x *= x; x %= mod;} return p % mod;}
using namespace std;
# define INF 1e15
struct lex_compare {
    bool operator() (const pair<db,ll>  p1, const pair<db,ll> p2){
        return (p1.first ==  p2.first) ? p1.ss < p2.ss : p1.first > p2.first;
    }
};
#define MAXN 1005


int main(){
    FIO;
    ll n; cin >> n;
    ll arr[n];
    forn(i,0,n) cin >> arr[i];
    if(n == 1){
        cout << 0 << endl;
        return 0;
    }
    if(n == 2){
        cout << max(arr[0], arr[1]) << endl;
        return 0;
    }
    sort(arr,arr+n);
    reverse(arr,arr+n);
    ll sum = arr[0];
    ll j = 1;
    ll i = 1;
    while( j < n-1){
        sum += arr[i];
        j++;
        if(j < n-1){
            sum+= arr[i];
            i++;
            j++;
        }else{
            break;
        }
        //dbg(sum);
    }
    cout << sum << endl;
    return 0;
}


Measured memory_bytes: 5204
//#include "bits/stdc++.h"
#include <iostream>
#include <vector>
#include <map>
#include <utility>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <complex>
#include <bitset>
#include <functional>
#include <stack>
#include <regex>
#include <tuple>
#include <iomanip>

#define int long long
#define REP(i,a,n) for(int i=a;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define REV(i,a,n) for(int i=n;i>=a;--i)
#define all(e) e.begin(),e.end()
#define rall(e) e.rbegin(),e.rend()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define show(n) cerr<<#n<<" = "<<n<<endl
#define showp(n) cerr<<n.fs<<", "<<n.sc<<endl
#define shows(n) for(auto z:n){cerr<<z<<", ";}cerr<<endl
#define showsp(n) for(auto z:n){cerr<<z.fs<<" "<<z.sc<<", "}cerr<<endl

#define yes puts("Yes")
#define no puts("No")
#define case(i) printf("Case #%lld: ",i)

using namespace std;

using vi=vector<int>;
using pint=pair<int,int>;

inline void io(){cin.tie(0);ios::sync_with_stdio(false);cout.tie(0);cout<<fixed<<setprecision(20);}
inline int  in(){int n;scanf("%lld",&n);return n;}
inline void out(int n){printf("%lld\n",n);}

const int INF=1LL<<55;
const int MOD=1000000007;
const double EPS=1e-8;

string s;
int w;

signed main(){
    io();
    cin>>s;
    cin>>w;
    for(int i = 0;i < s.size();i+=w){
        cout<<s[i];
    }cout<<endl;

    return 0;
}


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

using namespace std;
using ll = long long;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  int ans = 0;
  for (int i = 0; i < s.size(); i++) {
    if (i % 2 == 0) {
      if (s[i] != 'g') {
        ans--;
      }
    } else if (s[i] == 'g') {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}

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

int main(){
  int n;
  cin >> n;
  vector<double> a(n);
  double ans = 0;
  for(int i = 0; i < n; i++){
    cin >> a[i];
  }
  for(int i = 0; i < n; i++){
    ans += (double)(1 / a[i]);
  }
  cout << fixed << setprecision(15) << (double)(1 / ans) << endl;
}

Measured memory_bytes: 3708
x, y = gets.split.map(&:to_i)

t = 0
k = 0

answer = "No"

(0..x).each do |i|
  t = i
  k = x - i
  amnt_legs = (2 * t) + (4 * k)
  if amnt_legs == y
    answer = "Yes"
    break
  end
end

puts answer

Measured memory_bytes: 14288
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <algorithm>
#include <cstdio>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <fstream>
#include <cmath>
#include <random>
#include <complex>
#include <functional>

#define ll int64_t
#define Rep(i, n) for (ll i = 0; i < n; i++)
using namespace std;
typedef vector<ll> vec;
typedef vector<vec> mat;

const ll inf = 1LL << 60;

template<class T> inline void chmin(T& a, T b) {
    if (a > b) {
        a = b;
    }
}
template<class T> inline void chmax(T& a, T b) {
    if (a < b) {
        a = b;
    }
}

const int MOD = 1e9+7;
class mint {
    ll x;
public:
    mint(ll x = 0) : x((x % MOD + MOD) % MOD) {}
    
    mint operator -() const {
        return mint(-x);
    }
    
    mint &operator +=(const mint &a) {
        if ((x += a.x) >= MOD) x -= MOD;
        return *this;
    }

    mint &operator -=(const mint &a) {
        if ((x += MOD - a.x) >= MOD) x -= MOD;
        return *this;
    }

    mint &operator *=(const mint &a) {
        (x *= a.x) %= MOD;
        return *this;
    }

    mint operator +(const mint &a) const {
        mint res(*this);
        return res += a;
    }

    mint operator-(const mint &a) const {
        mint res(*this);
        return res -= a;
    }

    mint operator *(const mint &a) const {
        mint res(*this);
        return res *= a;
    }

    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const {
        return pow(MOD - 2);
    }

    mint &operator /=(const mint &a) {
        return (*this) *= a.inv();
    }

    mint operator /(const mint &a) const {
        mint res(*this);
        return res /= a;
    }

    friend ostream &operator<<(ostream& os, const mint &m) {
        os << m.x;
        return os;
    }
};


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

    ll N;
    cin >> N;
    vec A(N);
    Rep (i, N) {
        cin >> A[i];
    }

    vector<map<ll, ll>> cnt(N);
    Rep (i, N) {
        ll e = A[i];
        for (ll j = 2; j*j <= e; j++) {
            if (e % j == 0) {
                while (e % j == 0) {
                    cnt[i][j]++;
                    e /= j;
                }
            }
        }
        if (e > 1) {
            cnt[i][e]++;
        }
    }

    map<ll, ll> num;
    Rep (i, N) {
        for (auto e : cnt[i]) {
            chmax(num[e.first], e.second);
        }
    }

    mint L(1);
    for (auto e : num) {
        L *= mint(e.first).pow(e.second);
    }

    mint ans(0);

    Rep (i, N) {
        ans += L * mint(A[i]).inv();
    }

    cout << ans << endl;
    // Rep (i, N) {
    //     cout << A[i] << "\n";
    //     for (auto e : cnt[i]) {
    //         cout << e.first << " " << e.second << "\n";
    //     }
    // }

}

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


int main() {
	int N;
	int Brick;
	int crash = 0;
	int count = 1;

	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> Brick;
		if (Brick == count) {
			count++;
		}
		else {
			crash++;
		}
	}

	if (N == crash)crash = -1;

	cout << crash;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
    using namespace std;
    #define ll long long int
    #define pb push_back
    #define mk make_pair
    #define ft first
    #define sc second
    #define ppb pop_back
    #define sz size
    #define forn(i,a,n) for(i=a;i<n;i++)
    #define M 1000000007
    #define inf 2e18
    
    int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    ll x; cin>>x;
    ll arr[] = {100,101,102,103,104,105};
    ll dp[100005];
    memset(dp,0,sizeof dp);
    dp[0]=1;
    
    ll i,j;
    for(i = 0; i<6; i++){
        for(j = arr[i]; j<=100000;j++){
            if(dp[j-arr[i]]) dp[j]=1 ;
        }
    } 
    if(dp[x])cout<<"1";
    else
        cout<<"0";

    return 0;
    } 

Measured memory_bytes: 1024
#include<iostream>
#include<string>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

bool check(string s){
	bool res=true;
	rep(i,s.size()){
		if(s[i]=='('){
			int cnt[2]={0,0};
			bool con=false;
			loop(j,i+1,s.size()){
				if(cnt[0]==0 && cnt[1]==0 && s[j]==')'){
					string next=s.substr(i+1,j-i-1);
					i=j;
					if(!check(next))return false;
					con=true;
					break;
				}else if(s[j]=='(')cnt[0]++;
				else if(s[j]==')')cnt[0]--;
				else if(s[j]=='[')cnt[1]++;
				else if(s[j]==']')cnt[1]--;
			}
			res&=con;
		}else if(s[i]=='['){
			int cnt[2]={0,0};
			bool con=false;
			loop(j,i+1,s.size()){
				if(cnt[0]==0 && cnt[1]==0 && s[j]==']'){
					string next=s.substr(i+1,j-i-1);
					i=j;
					if(!check(next))return false;
					con=true;
					break;
				}else if(s[j]=='(')cnt[0]++;
				else if(s[j]==')')cnt[0]--;
				else if(s[j]=='[')cnt[1]++;
				else if(s[j]==']')cnt[1]--;
			}
			res&=con;
		}else if(s[i]==')')return false;
		else if(s[i]==']')return false;
	}
	return res;
}

int main(){
	string s;
	while(1){
		getline(cin,s);
		if(s==".")break;
		if(check(s))cout<<"yes"<<endl;
		else cout<<"no"<<endl;
	}	
	return 0;
}

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

map<int, int> even; // elem:frequency (k:v)
map<int, int> odd;
int n, c, maxeven, axeven, maxodd, axodd, whatodd, whateven;

int main(){
    cin >> n;
    for (int i=1; i<=n; i++){
        cin >> c;
        if (i%2){ // odd
            if (odd.find(c) == odd.end()){ // not in
                odd[c] = 1;
            } else {odd[c] += 1;}
        } else {
            if (even.find(c) == even.end()){ // not in
                even[c] = 1;
            } else {even[c] += 1;}
        }
    }
    for (pair<int, int> x : even){
        if (x.second > maxeven){
            whateven = x.first;
            axeven = maxeven;
            maxeven = x.second;
        } else if (x.second > axeven){
            axeven = x.second;
        }
    }
    for (pair<int, int> x : odd){
        if (x.second > maxodd){
            whatodd = x.first;
            axodd = maxodd;
            maxodd = x.second;
        } else if (x.second > axodd){
            axodd = x.second;
        }
    }
    if (whatodd != whateven){
        cout << n-maxodd-maxeven;
    } else {
        if (axeven>axodd) cout << n-maxodd-axeven;
        else cout << n-axodd-maxeven;
    }
}

Measured memory_bytes: 4992
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
using ld = long double;
template<typename T> using V = vector<T>;
template<typename T> using VV = vector<vector<T>>;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(),(v).end()
#define siz(v) (ll)(v).size()
#define rep(i,a,n) for(ll i=a;i<(ll)(n);++i)
#define repr(i,a,n) for(ll i=n-1;(ll)a<=i;--i)
#define ENDL '\n'
typedef pair<int,int> Pi;
typedef pair<ll,ll> PL;
constexpr ll mod = 1000000007;
constexpr ll INF = 1000000099;
constexpr ll LINF = (ll)(1e18 +99);
const vector<ll> dx={-1,1,0,0},dy={0,0,-1,1};
template<typename T,typename U> inline bool chmin(T& t, const U& u){if(t>u){t=u;return 1;}return 0;}
template<typename T,typename U> inline bool chmax(T& t, const U& u){if(t<u){t=u;return 1;}return 0;}
template<typename T> inline T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<typename T,typename Y> inline T mpow(T a, Y n) {
  T res = 1;
  for(;n;n>>=1) {
    if (n & 1) res = res * a;
    a = a * a;
  }
  return res;
}



signed main(){
  cin.tie(0);ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(20);
  ll a,b;cin>>a>>b;
  ll ans=-1;
  rep(i,1,1000000){
    if(i*8/100 ==a && i*10/100==b){
      ans=i;
      break;
    }
  }

  cout<<ans<<ENDL;
}
//! ( . _ . ) ! 
//CHECK overflow,vector_size,what to output?

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

int main(){
    string str;
    cin >> str;
    int count = 0;
    for (int i = 0; i < 3; i++){
        if (str.at(i) == str.at(i+1)) count++;
    }
    if (count >= 1) cout << "Bad" << endl;
    else cout << "Good" << endl;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
const int maxN = 102;
int a[maxN] = {0}, b[maxN] = {0}, c[maxN] = {0};
int main()
{
	int n;
	cin >> n;
	for(int i = 1; i <= n; i++)
		cin >> a[i];
	for(int i = 1; i <= n; i++)
		cin >> b[i];
	for(int i = 2; i <= n; i++)
		cin >> c[i];
	long long ans = 0;
	for(int i = 1; i <= n; i++)
	{
		ans += b[a[i]];
		if(i-1 && a[i-1]+1 == a[i])
			ans += c[a[i]];
		//cout << ans << '\n';
	}
	cout << ans << '\n';
	return 0;
}

Measured memory_bytes: 256
#ifdef __LOCAL
  #define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
template<typename T> bool chmax(T &a,T b) {if(a<b) {a=b; return true;} return false;}
template<typename T> bool chmin(T &a,T b) {if(a>b) {a=b; return true;} return false;}
#define itn int
#define fi first
#define se second
#define intmax numeric_limits<int>::max()
#define llmax numeric_limits<ll>::max():
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(int)(n);i>=1;i--)
#define all(vec) vec.begin(),vec.end()
#define sortt(vec) sort((vec).begin(),(vec).end())
#define rsort(vec) sort((vec).rbegin(), (vec).rend())
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef tuple<ll,ll,ll> tlll;
typedef tuple<int,int,int> tiii;
const ll mod=1e9+7;
const int inf=1<<30;
const ll lnf=1ll<<60;

int prevv[100010]; //頂点の最大数
struct edge{
  int to;
  ll cost;
};

vector<ll> dijkstra(int n,vector<vector<edge> > G,int s){
  fill(prevv,prevv+n,-1);
  priority_queue<pll,vector<pll>,greater<pll> > que;
  vector<ll> dist(n,lnf);
  dist[s]=0;
  que.push(pii(0,s));
  while(!que.empty()){
    ll cost; int v;
    tie(cost,v)=que.top();
    que.pop();
    if(dist[v]<cost) continue;
    for(int i=0;i<G[v].size();i++){
      edge e=G[v][i];
      ll nc=e.cost;
      int nv=e.to;
      if(dist[nv]>dist[v]+nc){
        dist[nv]=dist[v]+nc;
        prevv[nv]=v;
        que.push(pll(dist[nv],nv));
      }
    }
  }
  return dist;
}

//頂点への最短路
vector<int> get_path(int t){
  vector<int> path(0);
  for(;t!=-1;t=prevv[t]) path.push_back(t);
  reverse(path.begin(),path.end());
  return path;
}

int main(){
  int n,m; cin >> n >> m;
  vector<vector<edge> > g(n,vector<edge>(0));
  rep(i,n-1){
    g[i+1].push_back({i,0});
  }
  rep(i,m){
    int l,r; ll c;
    cin >> l >> r >> c;
    l--; r--;
    g[l].push_back({r,c});
  }
  vector<ll> dist=dijkstra(n,g,0);
  ll ans=dist[n-1];
  if(ans==lnf) cout << -1 << endl;
  else cout << dist[n-1] << endl;
}

Measured memory_bytes: 19540
import java.lang.reflect.Array;
import java.util.*;
import java.io.*;
import java.lang.*;

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

        int a = sc.nextInt();
        int b = sc.nextInt();

        System.out.println(Math.max(Math.max(a+b,a-b),a*b) );

    }
}


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

int main(){
  int  n,i;
  cin >> n;
  for( i=1;i<10;i++){
    if(n%i==0 && (n/i)<10 ){
      cout << "Yes";
      break;
    }
  }
  if(i==10){
    cout << "No";
  }
  return 0;
}
      
    

      
    


Measured memory_bytes: 256
import sys
import math
import numpy as np
from heapq import heappush, heappop
pos=input()
pos=pos.split()
N=int(pos[0])
M=int(pos[1])
sum=0

item=input()
item=item.split()
item=list(map(float,item))

hq=[]
for i in item:
  heappush(hq,-i)
  
for j in range(1,M+1):
  temp=heappop(hq)
  heappush(hq,math.ceil(temp/2.0))
  
for k in range(0,N):
  sum-=heappop(hq)
print(int(sum))





Measured memory_bytes: 22364
#include <bits/stdc++.h>
 
using namespace std;
 
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for(int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

int tcard[110], hcard[110]; 

int main() {
	int N;
	while(scanf("%d", &N), N) {
		rep(i, N) scanf("%d", &tcard[i]);
		sort(tcard, tcard + N);
		int cnt = 0;
		FOR(i, 1, N * 2 + 1) {
			bool flag = true;
			rep(j, N) if(i == tcard[j]) {
					flag = false;
					break;
			}
			if(flag) hcard[cnt++] = i; 
		} 
		int t = N, h = N; 
		int field = 0;
		//rep(i, N) cout << tcard[i] << " " << hcard[i] << endl;
 		while(1) {
 			bool flag = false;
 			//A
 			rep(i, N) if(field < tcard[i]) {
 				field = tcard[i]; tcard[i] = -1; --t;
 				flag = true;
 				break;
 			}
 			if(!flag) field = 0;
 			//cout << "t = " << field << endl;
 			if(t == 0 || h == 0) break;
 			//B
 			flag = false;
 			rep(i, N) if(field < hcard[i]) {
 				field = hcard[i] ; hcard[i] = -1; --h;
 				flag = true;
 				break;
 			}
 			if(!flag) field = 0;
 			//cout << "h = " << field << endl;
 			if(t == 0 || h == 0) break;
		}
		printf("%d\n%d\n", h, t);
	}
	return 0;
}

Measured memory_bytes: 3168
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n, q;
  cin >> n >> q;
  string s;
  cin >> s;
  vector<int> acc(n + 1, 0);
  for(int i = 0; i < n - 1; ++i){
    if(s[i] == 'A' && s[i + 1] == 'C') acc[i + 2] = 1; 
  }
  acc[0] = 0;
  for(int i = 1; i < n + 1; ++i){
    acc[i] += acc[i - 1];
  }
  for(int i = 0, l, r; i < q; ++i){
    cin >> l >> r;
    cout << acc[r] - acc[l] << endl;
  }
}

Measured memory_bytes: 1408
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
const ll p=1000000007;
int main(){
  string s;
  cin >> s;
  int n=s.size();
  ll a=0;
  ll ans=0;
  vector<int> k(n,0);
  rep(i,n-1){
    if(s[i]=='B'&&s[i+1]=='C'){
      k[i]=1;
      k[i+1]=2;
    }
  }
  rep(i,n){
    if(k[i]==2)continue;
    if(s[i]=='A'){
      a++;
      continue;
    }
    if(k[i]==1){
      ans+=a;
      continue;
    }
    else a=0;
  }
  cout << ans << endl;
}


Measured memory_bytes: 1412
package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	sc.Scan()
	N, _ := strconv.Atoi(sc.Text())

	sc.Scan()
	K, _ := strconv.Atoi(sc.Text())

	A := make([]int, N)
	sum := 0
	for i := 0; i < N; i++ {
		sc.Scan()
		A[i], _ = strconv.Atoi(sc.Text())
		sum += A[i]
	}

	devis := devisors(sum)
	result := 1
	for i := len(devis) - 1; i > 0; i-- {
		dev := devis[i]
		r := make([]int, N)
		sum := 0
		for i, a := range A {
			r[i] = a % dev
			sum += a % dev
		}
		sort.Ints(r)

		need := 0
		for j := len(r) - 1; j > 0; j-- {
			if sum == 0 {
				need = max(need, sum)
				break
			}
			need += dev - r[j]
			sum -= dev
		}

		if need <= K {
			result = max(result, dev)
			break
		}
	}
	fmt.Println(result)
}

func devisors(n int) []int {
	result := make([]int, 0)
	for i := 1; i*i < n; i++ {
		if n%i == 0 {
			result = append(result, i, n/i)
		}
	}
	sort.Ints(result)
	return result
}

func max(s ...int) int {
	maxContent := s[0]
	for _, el := range s {
		if el > maxContent {
			maxContent = el
		}
	}
	return maxContent
}


Measured memory_bytes: 5376
var lines: string[] = [];
var reader: any = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on("line", function(line: string) {
  lines.push(line);
});
reader.on("close", function() {
  var s = lines[0];
  console.log(700 + (s.split("o").length - 1) * 100);
});


Measured memory_bytes: 7628