akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>

#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>

using namespace std;

void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }

template <typename T, typename V>
void __print(const pair<T, V> &x) {
    cerr << '{';
    __print(x.first);
    cerr << ',';
    __print(x.second);
    cerr << '}';
}
template <typename T>
void __print(const T &x) {
    int f = 0;
    cerr << '{';
    for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
    cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
    __print(t);
    if (sizeof...(v)) cerr << ", ";
    _print(v...);
}
#ifdef LOCAL
#define debug(x...)               \
    cerr << "[" << #x << "] = ["; \
    _print(x)
#else
#define debug(x...)
#endif

#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

typedef long long ll;

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

    string S;
    cin >> S;

    int counter_1 = 0;
    rep(i, S.length()) {
        if (i % 2 == 0) {  //偶数番目が1
            if (S[i] == '1') {
                counter_1++;
            }
        } else { //奇数番目が0
            if (S[i] == '0') {
                counter_1++;
            }
        }
        debug(counter_1);
    }
    int counter_2 = 0;
    rep(i, S.length()) {
        if (i % 2 == 0) {  //偶数番目が0
            if (S[i] == '0') {
                counter_2++;
            }
        } else { //奇数番目が1
            if (S[i] == '1') {
                counter_2++;
            }
        }
        debug(counter_2);
    }

    cout << min(counter_1, counter_2) << endl;
}


Measured memory_bytes: 512
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <tuple>
#include <stdlib.h>
using namespace std;
#define PI 3.14159265358979
typedef long long int ll;

int main()
{
	int a,b,N;
	string S,T;
    cin>>N>>S>>T;
    for(int i=0;i<N;i++)
    {
    	cout<<S[i]<<T[i];
    }
}


Measured memory_bytes: 256
export class Main {
  static main(input: string): string {
    const [n, ...ls] = input.split("\n");
    const nN = Number(n);
    let result = 0;
    ls.map(l => l.split(" ")).forEach(([x, u]) => {
      if (u === "JPY") {
        result += Number(x);
      } else if (u === "BTC") {
        result += Number(x) * 380000;
      }
    });
    return `${result}`;
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));

Measured memory_bytes: 11468
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
# include <unordered_map>
# include <numeric>
# include <complex>
# include <bitset>
# include <random>
# include <chrono>
# include <cstdlib>
# include <tuple>
# include <array>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr int INF = 2147483647;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr double HDINF = 50000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define RALL(qpqpq)           (qpqpq).rbegin(),(qpqpq).rend()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define RFOR(i,tptpt,ypypy)  for(LL i=(tptpt);i>=(ypypy);i--)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)

double n, m, d;

int main() {
	cin >> n >> m >> d;
	if (d == 0) {
		cout << fixed << setprecision(13) << (m-1)/ n << endl;
		return 0;
	}
	cout << fixed << setprecision(13) << (((n - d) * 2)*(m - 1) / (n*n)) << endl;
}

Measured memory_bytes: 256
require 'set'; require 'prime'; require 'pp'
INF=Float::INFINITY; MOD=10**9+7
n = gets.chomp.to_i
a = gets.chomp.split.map(&:to_i)

cuxor = 0
a.each do |e|
  cuxor ^= e
end

ans = []
a.each do |e|
  ans << (cuxor ^ e)
end

puts ans.join(' ')


Measured memory_bytes: 39648
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = n-1; i >= 0; i--)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
typedef long long ll;
using P = pair<int,int>;
using VI = vector<int>;
using VVI = vector<vector<int>>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using VP = vector<P>;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }

int main(){
    int x;
    cin >> x;
    if (360 % x == 0){
        cout << (360 / x) << endl;
    }else{
        for(int k = 1; k <= 360; k++){
            if ((x * k) % 360 == 0){
                cout << k << endl;
                return 0;
            }
        }
    }
    return 0;
}

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

struct card{
	int num;
	int us;
};

int main(){
	int a, b;
	int c;
	card cards[11];
	while(cin >> a >> b >> c){
		for(int i = 1; i <= 10; i++){
			cards[i].num = i;
			cards[i].us = 1;
		}
		int me = a + b;
		cards[a].us = 0;
		cards[b].us = 0;
		cards[c].us = 0;
		int win = 0;
		int lose = 0;
		for(int i = 1; i <= 10; i++){
			if(cards[i].us){
				if(me + i <= 20){
					win++;
				}else{
					lose++;
				}
			}
		}
		if(win >= lose){
			cout << "YES" << endl;
		}else {
			cout << "NO" << endl;
		}
	}
	return 0;
}

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

int d, g, ans = 1000;
int p[10], c[10];

void solve(int i, int rest_max, int sum, int cnt){
    if(i == d){
        if(sum < g){
            int tmp = 100 * (rest_max+1);
            int need = (g - sum + tmp - 1) / tmp;
            if(need < p[rest_max]) cnt += need;
            else return;
        }
        ans = min(ans, cnt);
        return;
    }
    solve(i+1, i, sum, cnt);
    sum += 100 * (i+1) * p[i] + c[i];
    solve(i+1, rest_max, sum, cnt + p[i]);
    return;
}

int main(){
    cin >> d >> g;
    for(int i = 0; i < d; i++){
        cin >> p[i] >> c[i];
    }
    solve(0, 0, 0, 0);
    cout << ans << endl;
    return 0;
}

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

int main()
{
    int n, m,i,count=0,vote = 0;
    float temp;
    cin >> n >> m;
    int arr[n];
    for(i = 0; i < n; i++)
        cin >> arr[i];
    for(i = 0; i < n; i++){
        vote = vote + arr[i];
    };
    temp = ((1.0/(4 * m)) * vote);
    for(i = 0; i < n; i++){
        if(arr[i] >= temp) count++;
    }
    if(count >= m) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<deque>
#include<map>
#include<bitset>

using namespace std;
using ll = long long;

#define rep(i, n) for(int i = 0;i < (n);i++)
#define repr(i, n) for(int i = (n);i >= 0;i--)
#define repf(i, m, n) for(int i = (m);i < (n);i++)

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1;} return 0;}
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1;} return 0;}

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

//////////////////////////////////////////////////

const ll mod = 1e9+7;

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

    // 前処理
    vector<ll> inv(n+1), kaijo(n+1);
    inv[1] = 1;
    for (int i = 2; i <= n; i++) {
        inv[i] = mod - (mod/i)*inv[mod%i] % mod;
    }
    kaijo[0] = 1;
    for (int i = 1; i <= n; i++) {
        kaijo[i] = kaijo[i-1] * i % mod;
    }

    ll a = 0;
    ll ans = 0;
    repf(i, 1, n) {
        (a += kaijo[n-1]*inv[i]) %= mod;
        (ans += a*(x[i]-x[i-1])) %= mod;
        // cout << a << endl;
    }

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

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

namespace AGC031_A
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();

            int[] abcCount = new int[26];

            Modulo mod = new Modulo(0);

            for (int i = 0; i < n; ++i)
            {
                char abc = s[i];
                ++abcCount[abc - 'a'];
            }

            int ans = 1;

            for (int i = 0; i < 26; ++i)
            {
                if (abcCount[i] != 0)
                {
                    ans = mod.Mul(ans, abcCount[i] + 1);
                }
            }

            Console.WriteLine("{0}", ans - 1);
        }

        class Modulo
        {
            private const int M = 1000000007;
            private readonly int[] m_facs;
            public int Mul(int a, int b)
            {
                return (int)(Math.BigMul(a, b) % M);
            }
            public Modulo(int n)
            {
                m_facs = new int[n + 1];
                m_facs[0] = 1;
                for (int i = 1; i <= n; ++i)
                {
                    m_facs[i] = Mul(m_facs[i - 1], i);
                }
            }
            public int Fac(int n)
            {
                return m_facs[n];
            }
            public int Pow(int a, int m)
            {
                switch (m)
                {
                    case 0:
                        return 1;
                    case 1:
                        return a;
                    default:
                        int p1 = Pow(a, m / 2);
                        int p2 = Mul(p1, p1);
                        return ((m % 2) == 0) ? p2 : Mul(p2, a);
                }
            }
            public int Div(int a, int b)
            {
                return Mul(a, Pow(b, M - 2));
            }
            public int Ncr(int n, int r)
            {
                if (n < r) { return 0; }
                if (n == r) { return 1; }
                int res = Fac(n);
                res = Div(res, Fac(r));
                res = Div(res, Fac(n - r));
                return res;
            }
        }
    }
}


Measured memory_bytes: 13408
import java.io.*;
import java.util.*;
import java.util.function.*;

final class Solver {
	void solve(Supplier<String> sc) {
		String S = sc.get();
		var chars = S.toCharArray();
		long sum = 0;
		for (char c : chars) {
			sum += c - '0';
		}
		System.out.println(sum % 9 == 0 ? "Yes" : "No");
	}
}

class Main {
	public static void main(String... args) {
		System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
		var reader = new BufferedReader(new InputStreamReader(System.in));
		new Solver().solve(new Supplier<>() {
			StringTokenizer line;

			public String get() {
				while (line == null || !line.hasMoreTokens()) try {
					line = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
				return line.nextToken();
			}
		});
		System.out.flush();
	}
}

Measured memory_bytes: 37368
n = int(input())

answer = [0, 0]

for i in range(n):
    taro, hanako = input().split()
    if taro == hanako:
        answer[0] += 1
        answer[1] += 1
    elif hanako < taro:
        answer[0] += 3
    else:
        answer[1] += 3

print(*answer)


Measured memory_bytes: 5600
n,x = map(int,input().split())
a_L = list(map(int,input().split()))

a_L = list(sorted(a_L))

counter = 0
for val in range(n):
    if x - a_L[val] >= 0 and val != n-1:
        counter += 1
        x = x-a_L[val]

    if x - a_L[val] == 0 and val == n-1:
        counter +=1
        break

print(counter)

Measured memory_bytes: 38384
#include <bits/stdc++.h>
#include<chrono>
using namespace std;
using ll = long long;

int main() {
  int A, B;
  cin >> A >> B;
  bool check = false;
  int ans;
  for (int i = 1; i <= B*20; i++) {
    int a = i*0.08;
    int b = i*0.1;
    if (a == A && b == B) {
      check = true;
      ans = i;
      break;
    }
  }
  if (check) {
    cout << ans << endl;
  }
  else {
    cout << -1 << endl;
  }
}

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();
        int[][] g = buildGraph(sc, n, n-1);
        int[] c = new int[n];
        long sum = 0L;
        int max = 0;
        for (int i = 0; i < n; i++) {
            c[i] = sc.nextInt();
            sum += c[i];
            if(max < c[i]) max = c[i];
        }
        sum -= max;
        Arrays.sort(c);
        int[] d = new int[n];
        Arrays.fill(d, -1);
        ArrayDeque< Integer> q = new ArrayDeque<>();
        q.add(0);
        d[0] = max;
        int idx = n-2;
        while(!q.isEmpty()){
            for(int v : g[q.poll()]){
                if(d[v] < 0){
                    d[v] = c[idx];
                    idx--;
                    q.add(v);
                }
                if(idx < 0) break;
            }
        }
        StringBuilder sb = new StringBuilder(n*2);
        for (int i = 0; i < n; i++) {
            sb.append(d[i]).append(" ");
        }
        System.out.println(sum);
        System.out.println(sb.toString());
        sc.close();

    }
    public static int[][] buildGraph(Scanner sc, int n, int m){
        int[][] graph = new int[n][];
        int[][] edges = new int[m][2];
        int[] deg = new int[n];
        for (int i = 0; i < m; i++) {
            int a = sc.nextInt() -1;
            int b = sc.nextInt() -1;
            edges[i][0] = a;
            edges[i][1] = b;
            deg[a]++;
            deg[b]++;
        }
        for (int i = 0; i < n; i++) {
            graph[i] = new int[deg[i]];
        }
        for (int i = 0; i < m; i++) {
            int a = edges[i][0];
            int b = edges[i][1];
            graph[a][--deg[a]] = b;
            graph[b][--deg[b]] = a;
        }

        return graph;
    }

}



Measured memory_bytes: 43880
#include <iostream>
#include <string>
#include <cctype>
using namespace std;



int main()
{
	int  n;
	string str1, str2;

	cin >> n;

	int cnt1 = 0, cnt2 = 0;

	for (int i = 0; i < n; i++) {
		cin >> str1 >> str2;
		if (str1 > str2)cnt1 += 3;
		else if (str1 < str2)cnt2 += 3;
		else if (str1 == str2)cnt1 += 1, cnt2 += 1;
	}
	cout << cnt1 << " " << cnt2 << endl;
}

Measured memory_bytes: 3148
class Dice
  def initialize(ary)
    @ary = ary
  end

  def roll(direction)
    case direction
    when "E"
      tmp = @ary[0]
      @ary[0] = @ary[3]
      @ary[3] = @ary[5]
      @ary[5] = @ary[2]
      @ary[2] = tmp
    when "N"
      tmp = @ary[0]
      @ary[0] = @ary[1]
      @ary[1] = @ary[5]
      @ary[5] = @ary[4]
      @ary[4] = tmp
    when "S"
      tmp = @ary[0]
      @ary[0] = @ary[4]
      @ary[4] = @ary[5]
      @ary[5] = @ary[1]
      @ary[1] = tmp
    when "W"
      tmp = @ary[0]
      @ary[0] = @ary[2]
      @ary[2] = @ary[5]
      @ary[5] = @ary[3]
      @ary[3] = tmp
    end
  end

  def top
    puts @ary[0]
  end
end

dice = Dice.new(gets.chomp.split(" ").map(&:to_i))
method = gets.chomp.split("")
method.each do |i|
  dice.roll(i)
end
dice.top

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

int main(void) {

    ll N; cin>>N;
    vector<ll> A(N);
    ll All=0;
    for (int i = 0; i < N; ++i) {
        cin>>A[i];
        All += A[i];
    }
    ll minimum = 2020202020;
    ll sum=0;
    for (int i = 0; i < N-1; ++i) {
        sum += A[i];
        minimum = min(minimum, abs((All -sum)-sum));
    }

    cout<<minimum<<endl;


    return 0;
}


Measured memory_bytes: 1792
n = input()
li = list(map(int, input().split()))
count = 0


#all 全ての要素がTrueならTrue
while all(a % 2 == 0 for a in li):
    li = [ a / 2 for a in li]
    count += 1
# a,b = map(int, input().split())
print(count)

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

const double pi  = 2 * acos(0.0);
const double eps = 1e-8;

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

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

typedef int Cost;
struct Edge {
  int src, dst; Cost cost;
  Edge(int s, int d, Cost c) : src(s), dst(d), cost(c) {}
};
typedef vector<Edge>  Edges;
typedef vector<Edges> Graph;
typedef vector<Cost>  Array;
typedef vector<Array> Matrix;

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

struct UnionFind {
  vector<int> par;
  UnionFind(int size_) : par(size_) { for(int i = 0; i < size_; i++) par[i] = i; }
  void unite(int x, int y) {
    if ((x = find(x)) != (y = find(y))) {
      if (par[y] < par[x]) swap(x, y);
      par[x] = y;
    }
  }
  bool same(int x, int y) { return find(x) == find(y); }
  int find(int x) { return par[x] == x ? x : par[x] = find(par[x]); }
};

int main(void) {
  ios_base::sync_with_stdio(false); cin.tie(0);
  int n, q, com, x, y;
  cin >> n >> q;
  UnionFind uf = UnionFind(n);
  for (int i = 0; i < q; i++) {
    cin >> com >> x >> y;
    if (com == 0) uf.unite(x, y);
    else if (com == 1) cout << (uf.same(x, y) ? 1 : 0) << endl;
  }
  return 0; 
}

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

bool isPrime(int x)
{
    if(x==1) return false;
    if(x<=3) return true;
    if(x%2==0) return false;
    if(x%3==0) return false;
    int lim = sqrt(x);
    for(int i=5; i<=lim; i+=4) {
        if(x%i == 0) return false;
        i+=2;
        if(x%i == 0) return false;
    }
    return true;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, x, ans=0;
    cin>>n;
    for(int i=0; i<n; ++i) {
        cin>>x;
        if(isPrime(x)) ++ans;
    }
    cout<<ans<<'\n';
    return 0;
}

Measured memory_bytes: 1196
import java.util.Scanner;

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

Measured memory_bytes: 26128
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;
typedef long long ll;

int main(void)
{
	int a,b;
	scanf("%d%d",&a,&b);
	printf("%d",a*b);
	return 0;
}

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

#define debug(x) cout <<"DEBUG"<<" "<< #x << ":" << x << '\n'

// n回繰り返し
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   // 0-indexed昇順
#define rep1(i,n) for(int i = 1; i <= ((int)(n)); i++) // 1-indexed昇順
#define rrep(i,n) for(int i = ((int)(n)-1); i >= 0; i--)  // 0-indexed降順
#define rrep1(i,n) for(int i = ((int)(n)); i >= 1; i--)   // 1-indexed降順
#define all(x) (x).begin(),(x).end()

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vii;  // 2次元配列
typedef vector<ll> vll;
typedef vector<double> vd;
typedef pair<int, int> PII;

template<typename T>
using vec = vector<T>;
template<class T>
using maxheap = std::priority_queue<T>;
template<class T>
using minheap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template<class T,class U> inline bool chmax(T &a, const U &b){if(a<b){a=b;return 1;}return 0;}
template<class T,class U> inline bool chmin(T &a, const U &b){if(a>b){a=b;return 1;}return 0;}

const ld Pi = std::acos(-1.0L);
const ll infll = (1LL<<62)-1;
const int inf = (1<<30)-1;
const int mod = 1000000007;
// const int mod = 998244353;


/*FUNCs=================================================*/


/*MAIN==================================================*/
signed main(){
    int _StartTime_ = clock();
    cin.tie(nullptr);
    ios::sync_with_stdio(false);   //cin cout 高速化
    // cout << fixed << setprecision(15);

    string s;
    int n; cin >>n;
    int ans = (n+1)/2;


    cout << ans<< '\n';

    // printf("ExcutionTime: %d /ms\n",1000*(int)((clock()-_StartTime_)/CLOCKS_PER_SEC));
}

Measured memory_bytes: 256
n = int(input())

result = {
    "AC": 0,
    "WA": 0,
    "TLE": 0,
    "RE": 0,
}

for i in range(n):
    verdict = input()
    result[verdict] += 1

print("AC x {}".format(result["AC"]))
print("WA x {}".format(result["WA"]))
print("TLE x {}".format(result["TLE"]))
print("RE x {}".format(result["RE"]))

Measured memory_bytes: 9196
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

 class Main {
    public static void main(String[]args){
        Scanner scan = new Scanner(System.in);
        char s1[] = scan.next().toCharArray();
        char s2[] = scan.next ().toCharArray();
        Character[] newarr = new Character[s2.length];
        int i =0 ;
        for(char ch : s2){
            newarr[i++] = Character.valueOf(ch) ; 
        }
        Arrays.sort(s1 );
        Arrays.sort( newarr,Collections.reverseOrder());
        StringBuilder sb = new StringBuilder();
        for(Character x : newarr){
            sb.append(x);
        }
         
        //System.out.println(String.valueOf(s1)  + " "+sb.toString());
        if(String.valueOf(s1).compareTo(sb.toString()) < 0){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
        
        
    }
    
    
}


Measured memory_bytes: 22612
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int sh,sm,eh,em,k;

int main(){
	ios::sync_with_stdio(false);
	cin>>sh>>sm>>eh>>em>>k;
	em-=sm;
	if(em<0){
		em+=60;
		--eh;
	}
	eh-=sh;
	cout<<eh*60+em-k;
	
	
	return 0;
}

Measured memory_bytes: 3652
#include<iostream>
#include<vector>


using namespace std;

int main() {
	int n, m, c;
	cin >> n >> m >> c;
	vector<int> b(m);
	for (int i = 0; i < m; i++) {
		cin >> b[i];
	}
	vector<vector<int>> a(n, vector<int>(m));
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			cin >> a[i][j];
		}
	}
	int ans = 0;

	for (int i = 0; i < n; i++) {
		int sum = 0;
	
		for (int j = 0; j < m; j++) {
			sum += a[i][j] * b[j];
		}
		if (sum + c > 0) {
			ans++;
		}
	}
	cout << ans;
}

Measured memory_bytes: 3636
n, m = map(int, input().split())

a = []
for i in range(n):
   a.append(input())

b = []
for i in range(m):
   b.append(input())

def func(base, target):
   for i in range(n-m+1):
      check = base[i:i+m]
      for j in range(n-m+1):
         check2 = [line[j:j+m] for line in check]
         if check2 == target:
            return print('Yes')
   return print('No')

func(a,b)


Measured memory_bytes: 3064
#include<cstdio>
using namespace std;
int main()
{
	int h,w,i,j,k,flg,x;
	int  b[100][100];
	char a[100][100];
	scanf("%d %d",&h,&w);
	for(i=0;i<h;i++){
		scanf("%s",a[i]);
	}
	for(i=0;i<h;i++){
		for(j=0;j<w;j++){
			b[i][j]=-1;
		}
	}
	for(i=0;i<h;i++){
		flg=0;
		for(j=0;j<w;j++){
			if(a[i][j]=='c'){
				x=j;
				flg=1;
			}
			if(flg==1){
				b[i][j]=j-x;
			}
		}
	}
	
	for(i=0;i<h;i++){
		printf("%d",b[i][0]);
		for(j=1;j<w;j++){
			printf(" %d",b[i][j]);
		}
		printf("\n");
	}
	return 0;
}



Measured memory_bytes: 2776
#include <algorithm>
#include <iostream>
#include <vector>
#define repeat(i, n) for (int i = 0; (i) < (n); ++(i))
#define repeat_from(i, m, n) for (int i = (m); (i) < (n); ++(i))
using namespace std;
template <class T>
void setmax(T &a, T const &b) {
    if (a < b) a = b;
}

template <class T>
void setmin(T &a, T const &b) {
    if (a > b) a = b;
}

template <typename T, typename X>
auto vectors(T a, X x) { return vector<T>(x, a); }

template <typename T, typename X, typename Y, typename... Zs>
auto vectors(T a, X x, Y y, Zs... zs) {
    auto cont = vectors(a, y, zs...);
    return vector<decltype(cont)>(x, cont);
}

int main() {
    int R, C, K;
    cin >> R >> C >> K;
    auto grid = vectors(-1, R, C);
    repeat(i, K) {
        int r, c, v;
        cin >> r >> c >> v;
        --r, --c;
        grid[r][c] = v;
    }

    auto dp = vectors(-1LL, R, C, 4);
    dp[0][0][0] = 0;
    if (grid[0][0] != -1) dp[0][0][1] = grid[0][0];
    repeat(i, R) {
        repeat(j, C) {
            if (j - 1 >= 0) {
                repeat(k, 4) dp[i][j][k] = dp[i][j - 1][k];
                if (grid[i][j] != -1) {
                    repeat_from(k, 1, 4) {
                        if (dp[i][j - 1][k - 1] != -1)
                            setmax(dp[i][j][k], dp[i][j - 1][k - 1] + grid[i][j]);
                    }
                }
            }
            if (i - 1 >= 0) {
                repeat(k, 4) {
                    if (dp[i - 1][j][k] != -1) {
                        setmax(dp[i][j][0], dp[i - 1][j][k]);
                    }
                }
                if (grid[i][j] != -1) {
                    repeat(k, 4) {
                        if (dp[i - 1][j][k] != -1)
                            setmax(dp[i][j][1], dp[i - 1][j][k] + grid[i][j]);
                    }
                }
            }
        }
    }

    cout << *max_element(dp[R - 1][C - 1].begin(), dp[R - 1][C - 1].end()) << endl;
    return 0;
}

Measured memory_bytes: 670956
#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <vector>
#include <ctype.h>
#include <cmath>
#include <iomanip>
#include <ios>
#include <set>
#define ll long long
using namespace std;

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




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

int main()
{
    string s;
    cin >> s;
    int a = s[0] - '0', b = s[1] - '0', c = s[2] - '0', d = s[3] - '0';

    if (a + b + c + d == 7)
        printf("%d+%d+%d+%d=7\n", a, b, c, d);
    else if (a + b + c - d == 7)
        printf("%d+%d+%d-%d=7\n", a, b, c, d);
    else if (a + b - c + d == 7)
        printf("%d+%d-%d+%d=7\n", a, b, c, d);
    else if (a + b - c - d == 7)
        printf("%d+%d-%d-%d=7\n", a, b, c, d);
    else if (a - b + c + d == 7)
        printf("%d-%d+%d+%d=7\n", a, b, c, d);
    else if (a - b + c - d == 7)
        printf("%d-%d+%d-%d=7\n", a, b, c, d);
    else if (a - b - c + d == 7)
        printf("%d-%d-%d+%d=7\n", a, b, c, d);
    else if (a - b - c - d == 7)
        printf("%d-%d-%d-%d=7\n", a, b, c, d);
}

Measured memory_bytes: 3688
#include <iostream>
#include <algorithm>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

int main(void) {
    int x, y, z, k;
    cin >> x >> y >> z >> k;
    long long a[x], b[y], c[z];
    rep(i, x) cin >> a[i];
    rep(i, y) cin >> b[i];
    rep(i, z) cin >> c[i];

    long long ab[max(k, x*y)];
    rep(i, k) ab[i] = 0;
    rep(i, x) rep(j, y) {
        ab[i*y+j] = a[i] + b[j];
    }
    partial_sort(&ab[0], &ab[k], &ab[x*y], [](long long &a, long long &b) {return a > b;});
    // rep(i, k) cout << ab[0][i] << endl;

    long long abc[z*k];
    rep(i, z) rep(j, k) {
        abc[i*k+j] = c[i] + ab[j];
    }
    partial_sort(&abc[0], &abc[k], &abc[z*k], [](long long &a, long long &b) {return a > b;});
    rep(i, k) cout << abc[i] << endl;

}




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

int main(){
  vector<int> abc(3);
  repeat(i,3) cin >>abc.at(i);
  
  sort(abc.begin(),abc.end());
  
  string ans;
  if(abc[0]+abc[1]==abc[2]) ans = "Yes";
  else ans = "No";
    
  cout <<ans<< endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>

using namespace std;
const int maxn = 55;
char ch[maxn];

int main() {
    int n,k;
    cin>>n>>k;
    for (int i = 1; i <=n; ++i) {
        cin>>ch[i];
        if (k==i){
            ch[i]+=32;
        }
        cout<<ch[i];
    }
}

Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <vector>
#include <iostream>
#include <map>
#include <queue>
#include <cstring>
#include <string>
#include <algorithm>
using namespace std;
#define mst(a,b) memset((a),(b),sizeof(a))
#define rush() int T;scanf("%d",&T);while(T--)

typedef long long ll;
const int maxn = 100005;
const ll mod = 1e9+7;
const int INF = 0x3f3f3f3f;
const double eps = 1e-9;

int n,m;
int a[maxn];
char s[maxn];

int main()
{
    scanf("%d%d",&n,&m);
    n=n*n-m;
    printf("%d\n",n);
    return 0;
}


Measured memory_bytes: 256
import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
# @lru_cache(maxsize=None)
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp():
    '''
    一つの整数
    '''
    return int(input())
def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))

n = inp()
a = inpl()
dic = collections.defaultdict(int)
origin=0
for i in a:
    origin+=dic[i]
    dic[i] += 1

for i in a:
    print(origin-dic[i]+1)

Measured memory_bytes: 83276
#include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>
#include <tuple>
#include <set>
#include <map>
#include <unordered_map>
#include <complex>
#include <iomanip>
#include <cmath>
using namespace std;
typedef long long ll;

int main()
{
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  string ans = "Balanced";
  if (a + b > c + d) ans = "Left";
  else if (a + b < c + d) ans = "Right";
  cout << ans << endl;
}

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

int main()
{
	long double v, t, y;
	int count=0;
	int ans[100];
	while (cin >> v) {
		int n = 0;
		t = v / 9.8;
		y = 4.9*t*t;
		while(1){
			n++;
			if (y <= 5 * n - 5) {
				ans[count] = n;
				break;
			}
		}
		count++;
	}
	for (int a = 0; a < count; a++)
		cout << ans[a] << endl;
}

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

#define ALL(a) (a).begin(), (a).end()
#define ll long long

using namespace std;

signed main(){
    int n,a,b,c,d; cin >> n >> a >> b >> c >> d;
    cout << min(((n+a-1)/a)*b,((n+c-1)/c)*d) << endl;
    return 0;
}




Measured memory_bytes: 3032
#include <bits/stdc++.h>
 
using namespace std;
 
#define send {ios_base::sync_with_stdio(false);}
#define help {cin.tie(NULL); cout.tie(NULL);}
#define f first
#define s second
#define getunique(v) {sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end());}
typedef long long ll;
typedef long double lld;
typedef unsigned long long ull;
 
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v);
template<typename A, typename B> ostream& operator<<(ostream &cout, pair<A, B> const &p) { return cout << "(" << p.f << ", " << p.s << ")"; }
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v) {
	cout << "["; for(int i = 0; i < v.size(); i++) {if (i) cout << ", "; cout << v[i];} return cout << "]";
}
template<typename A, typename B> istream& operator>>(istream& cin, pair<A, B> &p) {
	cin >> p.first;
	return cin >> p.second;
}
 
mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());
// mt19937 rng(61378913);
/* usage - just do rng() */
 
void usaco(string filename) {
  // #pragma message("be careful, freopen may be wrong")
	freopen((filename + ".in").c_str(), "r", stdin);
	freopen((filename + ".out").c_str(), "w", stdout);
}
 
const lld pi = 3.14159265358979323846;
// const ll mod = 1000000007;
// const ll mod = 998244353;
// ll mod;
 


ll n, m, k, q, l, r, x, y, z;
const ll template_array_size = 1e6 + 674;
ll a[template_array_size];
ll b[template_array_size];
ll c[template_array_size];
string s, t;
ll ans = 0;

ll dp[100005];

void solve(int tc = 0) {
	cin >> n >> k;
	for (int i = 0; i < n; ++i) {
		cin >> a[i] >> b[i];
	}
	for (int i = 0; i <= k; ++i) dp[i] = 0;
	for (int i = 0; i < n; ++i) {
		for (int j = k - a[i]; j >= 0; --j) {
			dp[j + a[i]] = max(dp[j + a[i]], dp[j] + b[i]);
		}
	}
	
	ll ans = 0;
	for (int i = 0; i <= k; ++i) ans = max(ans, dp[i]);
	cout << ans << '\n';
}
 
int main() {
	#ifdef galen_colin_local
		auto begin = std::chrono::high_resolution_clock::now();
	#endif
	
	send help
 
	#ifndef galen_colin_local
		// usaco("cowland");
	#endif
	
	// usaco("cowland");
 
	int tc = 1;
	// cin >> tc;
	for (int t = 0; t < tc; t++) solve(t);
	
	#ifdef galen_colin_local
		auto end = std::chrono::high_resolution_clock::now();
		cout << setprecision(4) << fixed;
		// cout << "Execution time: " << std::chrono::duration_cast<std::chrono::duration<double>>(end - begin).count() << " seconds" << endl;
	#endif
} 

Measured memory_bytes: 4396
#include <bits/stdc++.h>
#define ll long long
#define db double
using namespace std;
const int M=11;
int n,m,k,a[M][M],ans;
int main()
{
    scanf("%d%d%d",&n,&m,&k);
    for(int i=0;i<n;i++)
    {
        char s[M];
        scanf("%s",s);
        for(int j=0;j<m;j++)
            a[i][j]=(s[j]=='#');
    }
    int NN=(1<<n),MN=(1<<m);
    for(int i=0;i<NN;i++)
        for(int j=0;j<MN;j++)
        {
            int cnt=0;
            for(int p=0;p<n;p++)
                for(int q=0;q<m;q++)
                    cnt+=(!(((1<<p)&i)||((1<<q)&j)))*a[p][q];
            ans+=(cnt==k);
            //printf("%d %d %d\n",i,j,cnt);
        }
    printf("%d\n",ans);
    return 0;
}


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

using namespace std;
typedef long long ll;

const int N=3e5+10;
const int mod=998244353;
int n;
int k,m;
int a[N];
int b[N];

map<int,int> mp;
struct pp{
    int x;
    int y;
    int index;
}p[N];

int cmp(pp a, pp b){
    return a.x<b.x;
}
int num[N];
int ans[N];
int parent[N];
set<int> s;
void Init()
{
    for(int i = 1;i <= n+10;i++){
        parent[i] = i;
        num[i]=1;
    }
    return;
}

int get_boss(int v)
{
    if(parent[v] == v)
        return v;
    else
    {
        //路径压缩(使搜索祖宗的过程中，路径中搜索的结点的父亲的变为祖宗)
        parent[v] = get_boss(parent[v]);
        return parent[v];
    }
}

void Merge(int v,int u) //u合并到v
{
    int t1 = get_boss(v);
    int t2 = get_boss(u);
    if(t1==t2) return ;
    if(num[t1]<num[t2]) swap(t1,t2);
    parent[t2] = t1;
    num[t1]+=num[t2];

    return;
}

int main()
{
    cin>>n;
    Init();
    for(int i=1;i<=n;i++){
        cin>>p[i].x>>p[i].y;
        p[i].index=i;
    }

    sort(p+1,p+1+n,cmp);
    for(int i=1;i<=n;i++){
        mp[p[i].y]=i;
    }



    for(int i=1;i<=n;i++){
        auto it1=s.lower_bound(p[i].y);
        //int stop=*it1;
        auto it2=s.begin();
        int start=*it2;

        if(it1!=it2){
            Merge(mp[start],mp[p[i].y]);
            it2++;
            for(; it2!=it1 ; ){
                Merge(mp[start],mp[*it2]);
                it2=s.erase(it2);
            }
        }
        else{
            s.insert(p[i].y);
        }
    }

    for(int i=1;i<=n;i++){
        ans[p[i].index]=num[get_boss(mp[p[i].y])];
    }
    for(int i=1;i<=n;i++)cout<<ans[i]<<endl;


}



Measured memory_bytes: 18384
#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
#define INF 0x3f3f3f3f
const int MOD=1e9+7;
const double eps=1e-8;
typedef long long ll;
//orz yht
using namespace std;
double dp[605][605],e[605];
vector<int> g[605],nx[605];
int main(){
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
    int n,m;
	cin>>n>>m;
	for(int i=1;i<=m;i++){
		int u,v;
		cin>>u>>v;
		g[v].push_back(u);
		nx[u].push_back(v);
	}
	e[n]=0;
	for(int i=n-1;i>=1;i--){
		e[i]=1;
		for(auto v : nx[i])
		e[i]+=e[v]/nx[i].size();
	}
	for(int i=n-1;i>=1;i--){
		for(auto v : nx[i]){
			for(int j=i+1;j<=n;j++)
			dp[i][j]+=dp[v][j]/nx[i].size();
		}
		dp[i][i]=1;
	}
	double mn=0;
	for(int i=1;i<=n;i++){
		if(nx[i].size()<2)
		continue;
		for(auto v : nx[i]){
			double minus=(e[i]-1)*nx[i].size();
			minus-=e[v];
			minus=minus/(nx[i].size()-1)+1-e[i];
			minus=minus*dp[1][i];
			mn=min(mn,minus);
			
		}
	}
	printf("%.10f",e[1]+mn);
	return 0;
}

Measured memory_bytes: 5376
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <map>
#include <set>

#define MIN_INT -2147483648
#define MAX_INT 2147483647
#define MIN_LONG -9223372036854775808L
#define MAX_LONG 9223372036854775807L
#define PI 3.141592653589793238462643383279502884L

#define long long long int

using std::vector;
using std::map;
using std::set;
using std::string;
using std::pair;
using std::cin;
using std::cout;
using std::cerr;

// @author: pashka

int main() {
    std::ios::sync_with_stdio(false);

    string s;
    cin >> s;
    int n = s.size();

    bool ok = true;
    if (s[0] == '0' || s[n - 1] == '1') {
        ok = false;
    }
    for (int i = 0; i < n - 1; i++) {
        if (s[i] != s[n - 2 - i]) ok = false;
    }
    if (!ok) {
        cout << -1;
        return 0;
    }

    int x = 1;
    for (int i = 0; i < n - 1; i++) {
        cout << x << " " << (i + 2) << "\n";
        if (s[i] == '1') {
            x = i + 2;
        }
    }

    return 0;
}

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

#define fi first
#define se second
#define show(x) cerr << #x << "=" << "\n"
typedef long long ll;
typedef unsigned long long ull;

using namespace std;

int n, k;
int a[101];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  cout << fixed;
#ifdef LOCAL_DEFINE
  FILE *stream1;
  //FILE *stream2;
  stream1 = freopen("in.txt", "r", stdin);
  //stream2 = freopen("out.txt", "w", stdout);
  if (stream1 == NULL) return 0;
  //if (stream2 == NULL) return 0;
#endif
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int sum = k;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (sum >= a[i]) {sum -= a[i];ans++;}
  }
  if (ans == n && sum > 0) {
    ans--;
  }
  cout << ans << endl;
#ifdef LOCAL_DEFINE
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << "s.\n";
  fclose(stream1);
  //fclose(stream2);
#endif
  return 0;
}


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

before = 0
route_sum = abs(a[0])
for i in range(1, n):
    route_sum += abs(a[i] - a[i - 1])

route_sum += abs(a[n - 1])

before = 0
print(route_sum - abs(a[0]) - abs(a[1] - a[0]) + abs(a[1]))
for i in range(1, n - 1):
    print(route_sum - abs(a[i] - a[i - 1]) - abs(a[i + 1] - a[i]) + abs(a[i + 1] - a[i - 1]))
print(route_sum - abs(a[n - 1]) - abs(a[n - 1] - a[n - 2]) + abs(a[n - 2]))

Measured memory_bytes: 13920
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MOD 1000000007
#define INF 1e9
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()

// 約数の列挙O(√n)
vector<ll> divisor(ll n){
    vector<ll> res;
    for(ll i=1LL;i*i<=n;i++){
        if(n%i==0){
            res.push_back(i);
            if(i!=n/i) res.push_back(n/i);
        }
    }
    sort(res.begin(), res.end());
    return res;
}

int main(){
    ll n;
    cin>>n;
    vector<ll> v=divisor(n);

    ll ans=0;
    for(int i=0;i<v.size();i++){
        ll m=v[i]-1;
        if(m<=0) continue;
        if(n/m == n%m) ans+=m;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 384
#include <ext/pb_ds/assoc_container.hpp>
#include <bits/stdc++.h>
using namespace std;
using namespace __gnu_pbds;
template <class c, class cmp = less<c> > using ordered_set = tree<c, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...) 
#endif
template<class T> ostream& operator<<(ostream &os, vector<T> V) {os << "[ "; for(auto v : V) os << v << " "; return os << "]";}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {return os << "(" << P.first << "," << P.second << ")";}
template <typename T,typename U>pair<T,U> operator+(const pair<T,U> & l,const std::pair<T,U> & r) { return {l.first+r.first,l.second+r.second};}
typedef long long int ll;
const ll mod =1e9+7;
const int maxn = 100005;
#define endl '\n'
#define ld long double
#define int ll
#define all(x) (x).begin(),(x).end()

int32_t main()
{ 
   IOS

   int n, d;
   cin >> n >> d;
   int ans = 0;
   for(int i = 1;i<=n;i++){
     int x, y;
     cin >> x >> y;
     if(x*x + y*y <= d*d){
       ans++;
     }
   }
   cout << ans << endl;
  


  
    


  
  
  


    


  
  

 
}

Measured memory_bytes: 3656
// 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
// ぜったいあきらめない
#include<bits/stdc++.h>
using namespace std;

#if defined(DAIJOBU)
#include "/home/ichigo/debug.hpp"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define deb(x...)
#endif
#define FIO {ios::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);}

map<char, int> cnt;

int main(){
	FIO
	
	string s, t;cin >> s >> t;
	s += s;
	if(s.find(t) != string::npos)puts("Yes");
	else puts("No");
	return 0;
}



Measured memory_bytes: 3236
#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstring>
using namespace std;

const int MAX_N = 15;
const int INF = (int)1e8;

int V;
int dp[MAX_N][1 << MAX_N];
vector<pair<int, int>> G[MAX_N];

int start;

int tsp(unsigned S, int v) {
  if(dp[v][S] != -1) return dp[v][S];
  if(S == 0 && v == start) return 0;
  int res = INF;
  for(int i = 0; i < (int)G[v].size(); i++) {
    int next = G[v][i].first;
    int d = G[v][i].second;
    if(S >> next & 1) {
      res = min(res, d + tsp(S & ~(1 << next), next));
    }
  }
  return dp[v][S] = res;
}

int main() {
  int E; cin >> V >> E;
  while(E--) {
    int s, t, d;
    cin >> s >> t >> d;
    G[s].push_back(make_pair(t, d));
  }
  int res = INF;
  for(int i = 0; i < V; i++) {
    start = i;
    memset(dp, -1, sizeof(dp));
    res = min(res, tsp((1 << V) - 1, i));
  }
  if(res == INF) cout << "-1" << endl;
  else cout << res << endl;
}

Measured memory_bytes: 3124
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<set>

using namespace std;


int main(){

    int n;
    cin >> n;
    vector<int> a(n);
    int t=0;
    for(int i=0;i<n;i++){
        cin >> a[i];
        t += a[i];
    }
    sort(a.begin(),a.end());
    int c=0;
    for(int i=a.size()-1;i>=0;i-=2) c += a[i];
    cout << c-(t-c) <<endl;
}


Measured memory_bytes: 256
/**
 *    author:  otera    
**/
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

#define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cerr << #x << " = " << (x) << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

void solve() {
	int n; cin >> n;
    vector<int> a(n), b(n);
    int suma = 0, sumb = 0;
    rep(i, n) {
        cin >> a[i];
        suma += a[i];
    }
    rep(i, n) {
        cin >> b[i];
        sumb += b[i];
    }
    int cnt = sumb - suma;
    int tmpa = 0, tmpb = 0;
    rep(i, n) {
        if(a[i] > b[i]) {
            tmpa += a[i] - b[i];
        } else if(a[i] < b[i]) {
            tmpb += (b[i] - a[i] + 1) / 2;
        }
    }
    if(cnt >= tmpa && cnt >= tmpb) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//int t; cin >> t; rep(i, t)solve();
	solve();
    return 0;
}

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

#define ll long long

const ll mod = 1000000007 ;

using namespace std ;

int main()
{
	ll n;
	cin>>n;
	ll A[n];
	for(ll i=0 ; i<n ; i++)
		cin>>A[i];
	vector<ll> v;
	ll sum = 0;
	for(ll i=0 ; i<n ; i++)
		sum+=A[i];
	ll ans = 0 ;
	for(ll i=0 ; i<n ; i++)
	{
		sum-=A[i];
		ans = (ans+((long long)A[i]*(sum%mod)%mod))%mod;
	}
	cout<<ans%mod;
}


Measured memory_bytes: 5116
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

template<typename T>
void print(const vector<T> &x) {
    int n = x.size();
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x) {
    int n = x.size();
    rep(i,n) {
        rep(j,x[i].size()) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

template<typename T>
void print(const vector<T> &x, int n) {
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x, int n, int m) {
    rep(i,n) {
        rep(j,m) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

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

void input_init() {
    cin.tie(0); ios::sync_with_stdio(false);
}

int main(int argc, char const *argv[]) {
    int a,b; cin>>a>>b;
    string s,t;
    rep(i,b) {
        s.push_back('0'+a);
    }
    rep(i,a) t.push_back('0'+b);
    if (s<t) cout << s << '\n';
    else cout << t << '\n';
    return 0;
}

Measured memory_bytes: 256