Problem p02608 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int(i) = (n); (i) >= (0); (i)--)
#define SIZE(x) ((int)(x).size())
#define GCD(a, b)                                                              \
  int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
#define QP(a, b)                                                               \
  int qp(int a, ll b) {                                                        \
    int ans = 1;                                                               \
    do {                                                                       \
      if (b & 1)                                                               \
        ans = 1ll * ans * a % mo;                                              \
      a = 1ll * a * a % mo;                                                    \
    } while (b >>= 1);                                                         \
    return ans;                                                                \
  }
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define all(v) (v).begin(), (v).end()

template <typename T> void chmax(T &a, T b) { a = max(a, b); }
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chadd(T &a, T b) { a = a + b; }
template <typename A, size_t N, typename T>
void FILL(A (&array)[N], const T &val) {
  std::fill((T *)array, (T *)(array + N), val);
}

typedef vector<int, int> vint;
typedef pair<int, int> pint;
typedef vector<pint> vpint;
typedef long long ll;

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1LL << 60;
const ll MOD = 1000000007LL;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<int> cnt(10000);
  for (int x = 1; x <= 100; x++) {
    for (int y = 1; y <= 100; y++) {
      for (int z = 1; z <= 100; z++) {
        cnt[x * x + y * y + z * z + x * y + y * z + z * x]++;
      }
    }
  }
  int N;
  cin >> N;
  for (int i = 1; i <= N; i++)
    cout << cnt[i] << endl;
  return 0;
}

Fixed submission:
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int(i) = (n); (i) >= (0); (i)--)
#define SIZE(x) ((int)(x).size())
#define GCD(a, b)                                                              \
  int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
#define QP(a, b)                                                               \
  int qp(int a, ll b) {                                                        \
    int ans = 1;                                                               \
    do {                                                                       \
      if (b & 1)                                                               \
        ans = 1ll * ans * a % mo;                                              \
      a = 1ll * a * a % mo;                                                    \
    } while (b >>= 1);                                                         \
    return ans;                                                                \
  }
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define all(v) (v).begin(), (v).end()

template <typename T> void chmax(T &a, T b) { a = max(a, b); }
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chadd(T &a, T b) { a = a + b; }
template <typename A, size_t N, typename T>
void FILL(A (&array)[N], const T &val) {
  std::fill((T *)array, (T *)(array + N), val);
}

typedef vector<int, int> vint;
typedef pair<int, int> pint;
typedef vector<pint> vpint;
typedef long long ll;

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1LL << 60;
const ll MOD = 1000000007LL;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<int> cnt(300000);
  for (int x = 1; x <= 100; x++) {
    for (int y = 1; y <= 100; y++) {
      for (int z = 1; z <= 100; z++) {
        cnt[x * x + y * y + z * z + x * y + y * z + z * x]++;
      }
    }
  }
  int N;
  cin >> N;
  for (int i = 1; i <= N; i++)
    cout << cnt[i] << endl;
  return 0;
}