Problem p02595 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#define repr(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) for (int i = 0; i < n; i++)
#define reprrev(i, a, b) for (int i = b - 1; i >= a; i--) // [a, b)
#define reprev(i, n) reprrev(i, 0, n)
#define _GLIBCXX_DEBUG

using ll = long long;
using ull = unsigned long long;
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const ll mod = 1e9 + 7;
void chmod(ll &M) {
  if (M >= mod)
    M %= mod;
  else if (M < 0) {
    M += (abs(M) / mod + 1) * mod;
    M %= mod;
  }
}
ll modpow(ll x, ll n) {
  if (n == 0)
    return 1;
  ll res = modpow(x, n / 2);
  if (n % 2 == 0)
    return res * res % mod;
  else
    return res * res % mod * x % mod;
}
int getl(int i, int N) { return i == 0 ? N - 1 : i - 1; };
int getr(int i, int N) { return i == N - 1 ? 0 : i + 1; };
long long GCD(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return GCD(b, a % b);
}

using namespace std;
/* <----------------------------------------------------------------------------------->
 */
/* <----------------------------------------------------------------------------------->
 */
/* <----------------------------------------------------------------------------------->
 */
/* <----------------------------------------------------------------------------------->
 */
int main() {
  ll N, D;
  cin >> N >> D;
  int count = 0;
  rep(i, N) {
    ll a, b;
    cin >> a >> b;
    // cout << a*a + b*b << " " << D*D << endl;
    if (a * a + b * b <= D * D)
      count++;
  }
  cout << count << endl;
}

Error: 0

Fixed submission:

#include <bits/stdc++.h>
#define repr(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) for (int i = 0; i < n; i++)
#define reprrev(i, a, b) for (int i = b - 1; i >= a; i--) // [a, b)
#define reprev(i, n) reprrev(i, 0, n)

using ll = long long;
using ull = unsigned long long;
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const ll mod = 1e9 + 7;
void chmod(ll &M) {
  if (M >= mod)
    M %= mod;
  else if (M < 0) {
    M += (abs(M) / mod + 1) * mod;
    M %= mod;
  }
}
ll modpow(ll x, ll n) {
  if (n == 0)
    return 1;
  ll res = modpow(x, n / 2);
  if (n % 2 == 0)
    return res * res % mod;
  else
    return res * res % mod * x % mod;
}
int getl(int i, int N) { return i == 0 ? N - 1 : i - 1; };
int getr(int i, int N) { return i == N - 1 ? 0 : i + 1; };
long long GCD(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return GCD(b, a % b);
}

using namespace std;
/* <----------------------------------------------------------------------------------->
 */
/* <----------------------------------------------------------------------------------->
 */
/* <----------------------------------------------------------------------------------->
 */
/* <----------------------------------------------------------------------------------->
 */
int main() {
  int N, D;
  cin >> N >> D;
  vector<vector<int>> p(N, vector<int>(N));
  int count = 0;
  rep(i, N) {
    int a, b;
    cin >> a >> b;
    if (a * a + b * b <= D * D)
      count++;
  }
  cout << count << endl;
}