alexjercan/bugnet huggingface dataset:
Problem p02608 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
#define sqr(x) ((x) * (x))
using namespace std;
typedef long long ll;
int n;

ll f(int t) {
  ll cnt = 0;
  for (ll x = 1; x * x <= t; x++) {
    for (ll y = 1; y <= t; y++) {
      ll f0 = sqr(x) + sqr(y) + x * y - n;
      if (f0 < 0) {
        ll delta = sqr(x + y) - 4 * (sqr(x) + sqr(y) + x * y - t),
           root = sqrt(delta);
        if (root * root == delta) {
          ll tmp = root - (x + y);
          if (tmp % 2 == 0 && tmp >= 2)
            cnt++;
        }
      } else
        break;
    }
  }
  return cnt;
}

int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    printf("%lld\\n", f(i));
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define sqr(x) ((x) * (x))
using namespace std;
typedef long long ll;
int n;

ll f(int t) {
  ll cnt = 0;
  for (ll x = 1; x <= t; x++) {
    for (ll y = 1; y <= t; y++) {
      ll f0 = sqr(x) + sqr(y) + x * y - n;
      if (f0 < 0) {
        ll delta = sqr(x + y) - 4 * (sqr(x) + sqr(y) + x * y - t),
           root = sqrt(delta);
        if (root * root == delta) {
          ll tmp = root - (x + y);
          if (tmp % 2 == 0 && tmp >= 2)
            cnt++;
        }
      }
    }
  }
  return cnt;
}

int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    printf("%lld\\n", f(i));
  }
  return 0;
}
Problem p02608 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
  int n;
  cin >> n;
  int f[n + 1];
  for (int i = 0; i <= n; i++) {
    f[i] = 0;
  }
  int sum = 0;

  for (int x = 1; x <= 100; x++) {
    if (x * x > 2 * n) {
      break;
    } else {
      for (int y = 1; y <= 100; y++) {
        if ((x + y) * (x + y) + y * y > 2 * n) {
          break;
        } else {
          for (int z = 1; z <= 100; z++) {
            if ((x + y) * (x + y) + (x + z) * (x + z) + (y + z) * (y + z) >
                2 * n) {
              break;
            } else {
              sum = (x + y) * (x + y) + (y + z) * (y + z) + (z + x) * (z + x);
              for (int i = 1; i <= n; i++) {
                if (sum == 2 * i) {
                  f[i - 1] += 1;
                }
                if (sum < 2 * i) {
                  break;
                }
              }
            }
          }
        }
      }
    }
  }

  for (int i = 1; i <= n; i++) {
    cout << f[i - 1] << endl;
  }
}


Error: TLE

Fixed submission:

#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
  int n;
  cin >> n;
  int f[n + 1];
  for (int i = 0; i <= n; i++) {
    f[i] = 0;
  }
  int sum = 0;

  for (int x = 1; x <= 100; x++) {
    if (x * x > 2 * n) {
      break;
    } else {
      for (int y = 1; y <= 100; y++) {
        for (int z = 1; z <= 100; z++) {
          sum = (x + y) * (x + y) + (y + z) * (y + z) + (z + x) * (z + x);
          for (int i = 1; i <= n; i++) {
            if (sum == 2 * i) {
              f[i - 1] += 1;
            }
            if (sum < 2 * i) {
              break;
            }
          }
        }
      }
    }
  }

  for (int i = 1; i <= n; i++) {
    cout << f[i - 1] << endl;
  }
}
Problem p02608 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <unordered_set>
#define ll long long

using namespace std;

ll f(ll n) {

  ll count = 0;

  for (ll x = 1; x <= n; x++) {

    for (ll y = 1; y <= n; y++) {

      for (ll z = 1; z <= n; z++) {
        if (pow(x, 2) + pow(y, 2) + pow(z, 2) + x * y + y * z + z * x == n) {
          count++;
        }
      }
    }
  }
  return count;
}

int main() {

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  ll N;

  cin >> N;

  map<ll, ll> occur;
  for (ll x = 1; x <= N; x++) {
    for (ll y = 1; y <= N - x; y++) {
      for (ll z = 1; z <= N - y; z++) {
        ll value = pow(x, 2) + pow(y, 2) + pow(z, 2) + x * y + y * z + z * x;

        if (value > N) {
          break;
        }

        occur[value]++;
      }
    }
  }

  for (ll i = 1; i <= N; i++) {
    cout << occur[i] << endl;
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <unordered_set>
#define ll long long

using namespace std;

ll f(ll n) {

  ll count = 0;

  for (ll x = 1; x <= n; x++) {

    for (ll y = 1; y <= n; y++) {

      for (ll z = 1; z <= n; z++) {
        if (pow(x, 2) + pow(y, 2) + pow(z, 2) + x * y + y * z + z * x == n) {
          count++;
        }
      }
    }
  }
  return count;
}

int main() {

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  ll N;

  cin >> N;

  for (ll i = 1; i <= N; i++) {
    cout << f(i) << endl;
  }

  return 0;
}
Problem p02608 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main() {
  ll n = 0;
  cin >> n;

  for (ll i = 1; i <= n; i++) {
    ll sum = 0;
    for (ll j = 1; j * j <= n; j++) {
      for (ll k = 1; k * k <= n; k++) {
        if ((j + k) * (j + k) < (4 * (j * j + k * k + j * k - i))) {
          continue;
        }
        if (sqrt(((j + k) * (j + k)) - (4 * (j * j + k * k + j * k - i))) -
                    (j + k) >=
                1 &&
            (sqrt(((j + k) * (j + k)) - (4 * (j * j + k * k + j * k - i))) -
             (j + k)) -
                    floor(sqrt(((j + k) * (j + k)) -
                               (4 * (j * j + k * k + j * k - i))) -
                          (j + k)) ==
                0) {
          // cout << i << j << k << endl;
          // cout << sqrt( ((j + k) * (j + k)) - (4 * (j * j + k * k + j * k -
          // i) ) ) - (j + k) << endl;
          sum++;
        }
      }
    }
    cout << sum << endl;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main() {
  ll n = 0;
  cin >> n;

  for (ll i = 1; i <= n; i++) {
    ll sum = 0;
    for (ll j = 1; j * j <= n; j++) {
      for (ll k = 1; k * k <= n; k++) {
        for (ll l = 1; l * l <= n; l++) {
          if (l * l + j * j + k * k + l * k + l * j + k * j == i) {
            sum++;
          }
        }
      }
    }
    cout << sum << endl;
  }
  return 0;
}
Problem p02608 (C++) — buggy submission, verdict: Time Limit Exceeded

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

ll fact(int x) {
  if (x == 1)
    return 1;
  else
    return x * fact(x - 1);
}

int main() {
  int n;
  cin >> n;
  int rt = sqrt(n) + 1;
  for (int i = 1; i <= n; i++) {
    int cnt = 0;
    for (int x = 1; x <= rt; x++) {
      for (int y = 1; y <= rt; y++) {
        for (int z = 1; z <= rt; z++) {
          if (x * x + y * y + z * z + x * y + y * z + z * x == i) {
            cnt++;
          } else if (x * x + y * y + z * z + x * y + y * z + z * x > i)
            break;
        }
      }
    }
    cout << cnt << endl;
  }
}


Error: TLE

Fixed submission:

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

ll fact(int x) {
  if (x == 1)
    return 1;
  else
    return x * fact(x - 1);
}

int main() {
  int n;
  cin >> n;
  int rt = sqrt(n) + 1;
  for (int i = 1; i <= n; i++) {
    int cnt = 0;
    for (int x = 1; x <= rt; x++) {
      for (int y = 1; y <= rt; y++) {
        for (int z = 1; z <= rt; z++) {
          if (x * x + y * y + z * z + x * y + y * z + z * x == i) {
            cnt++;
          }
        }
      }
    }
    cout << cnt << endl;
  }
}
Problem p02608 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
#define rep(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep_ll(i, x, n) for (ll i = x; i < (ll)(n); i++)
using namespace std;
typedef long long ll;
typedef unsigned long long u_ll;
typedef pair<int, int> pair_;
const long double PI = (acos(-1));
const int INF = 1001001001;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
ll mod = 1000000007;
int main() {
  ll n;
  cin >> n;
  // map<int, int> mp;
  vector<ll> aa(n + 1, 0);
  ll n_ = sqrt(n);
  rep(i, 1, n_) {
    ll i_ = i * i;
    rep(j, 1, n_) {
      ll j_ = j * j;
      ll ij = i * j;
      rep(k, 1, n_) {
        ll k_ = k * k;
        ll ik = i * k;
        ll jk = j * k;
        ll ans = i_ + j_ + k_ + ij + ik + jk;
        if (ans > n)
          continue;
        aa[ans]++;
      }
    }
  }
  rep(ii, 1, n + 1) cout << aa[ii] << endl;
  return 0;
}

Error: 0

Fixed submission:

#include <bits/stdc++.h>
#define rep(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep_ll(i, x, n) for (ll i = x; i < (ll)(n); i++)
using namespace std;
typedef long long ll;
typedef unsigned long long u_ll;
typedef pair<int, int> pair_;
const long double PI = (acos(-1));
const int INF = 1001001001;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
ll mod = 1000000007;
int main() {
  int n;
  cin >> n;
  // map<int, int> mp;
  vector<int> mp(n + 1, 0);
  int n_ = sqrt(n);
  rep(i, 1, n_) {
    int i_ = i * i;
    rep(j, 1, n_) {
      int j_ = j * j;
      int ij = i * j;
      rep(k, 1, n_) {
        int k_ = k * k;
        int ik = i * k;
        int jk = j * k;
        mp[i_ + j_ + k_ + ij + ik + jk]++;
      }
    }
  }
  rep(i, 1, n + 1) cout << mp[i] << endl;
  return 0;
}
Problem p02608 (C++) — buggy submission, verdict: Time Limit Exceeded


#include <bits/stdc++.h>
using namespace std;
using ll = long long;

typedef pair<int, int> P;
struct edge {
  int to, id;
};
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define mod 1000000007

using graph = vector<vector<ll>>;

int main() {
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = 0;
    for (int j = 1; j <= (int)sqrt(i); j++) {
      for (int k = j; k <= (int)sqrt(i); k++) {
        for (int l = k; l <= (int)sqrt(i); l++) {
          if (((j + k) * (j + k) + (k + l) * (k + l) + (j + l) * (j + l)) /
                  2.0 ==
              i) {
            int x, y, z;
            int temp = j + k + l;
            x = temp / 2 - (k + l);
            y = temp / 2 - (j + l);
            z = temp / 2 - (k + j);
            if (x == y && y == z)
              ans++;
            else if (x == y && y != z)
              ans += 3;
            else if (x == z && y != z)
              ans += 3;
            else if (y == z && x != z)
              ans += 3;
            else
              ans += 6;
          }
        }
      }
    }
    cout << ans << endl;
  }
}

Error: TLE

Fixed submission:


#include <bits/stdc++.h>
using namespace std;
using ll = long long;

typedef pair<int, int> P;
struct edge {
  int to, id;
};
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define mod 1000000007

using graph = vector<vector<ll>>;

int main() {
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = 0;
    for (int j = 1; j < 100; j++) {
      for (int k = j; k < 100; k++) {
        for (int l = k; l < 100; l++) {
          if (((j + k) * (j + k) + (k + l) * (k + l) + (j + l) * (j + l)) /
                  2.0 ==
              i) {
            int x, y, z;
            int temp = j + k + l;
            x = temp / 2 - (k + l);
            y = temp / 2 - (j + l);
            z = temp / 2 - (k + j);
            if (x == y && y == z)
              ans++;
            else if (x == y && y != z)
              ans += 3;
            else if (x == z && y != z)
              ans += 3;
            else if (y == z && x != z)
              ans += 3;
            else
              ans += 6;
          }
        }
      }
    }
    cout << ans << endl;
  }
}
Problem p02608 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
#define INF 2000000000
#define MOD 1000000007
#define EPS (1e-10)

using namespace std;

int f(int n) {
  int ans = 0;
  for (int x = n; x >= 1; x--) {
    if (x * x > n)
      continue;
    for (int y = x; y >= 1; y--) {
      if (y * y + x * x + x * y > n)
        continue;
      for (int z = y; z >= 1; z--) {
        int sum = x * x + y * y + z * z + x * y + y * z + z * x;
        if (n != sum)
          continue;
        set<int> set;
        set.insert(x);
        set.insert(y);
        set.insert(z);
        if (set.size() == 1) {
          ans++;
        } else if (set.size() == 2) {
          ans += 3;
        } else if (set.size() == 3) {
          ans += 6;
        }
      }
    }
  }
  return ans;
}
int main(int argc, char *argv[]) {

  int N;
  cin >> N;

  vector<int> ans(N);
  for (int i = N; i >= 1; i--) {
    ans[i - 1] = f(i);
  }
  for (int i = 0; i < N; i++) {
    cout << ans[i] << endl;
  }

  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define INF 2000000000
#define MOD 1000000007
#define EPS (1e-10)

using namespace std;

int main(int argc, char *argv[]) {

  int N;
  cin >> N;

  for (int i = 0; i < N; i++) {
    int ans = 0;
    for (int x = 1; x <= N; x++) {
      if (x * x > N)
        break;
      for (int y = x; y <= N; y++) {
        if (y * y + x * x + x * y > N)
          break;
        for (int z = y; z <= N; z++) {
          if (x * x + y * y + z * z > N)
            break;
          int n = x * x + y * y + z * z + x * y + y * z + z * x;
          set<int> set;
          set.insert(x);
          set.insert(y);
          set.insert(z);
          if ((i + 1) == n) {
            if (set.size() == 1) {
              ans++;
            } else if (set.size() == 2) {
              ans += 3;
            } else if (set.size() == 3) {
              ans += 6;
            }
          }
        }
      }
    }
    cout << ans << endl;
  }

  return 0;
}
Problem p02608 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
// for(int i = 0;i < num; i++){}
int main() {
  //

  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int num;
  int cnt = 0;
  scanf("%d", &num);
  // cin >> num;

  for (int i = 1; i <= num; i++) {
    cnt = 0;
    for (int x = 1; x <= sqrt(i); x++) {
      if (x * x + x > i)
        break;
      for (int y = 1; y <= sqrt(i); y++) {
        if (x * x + y * y + x * y + x + y > i)
          break;
        for (int z = 1; z <= sqrt(i); z++) {
          if (x * x + y * y + z * z + x * y + y * z + z * x > i)
            break;
          if (x * x + y * y + z * z + x * y + y * z + z * x == i)
            cnt++;
        }
      }
    }
    printf("%d\\n", cnt);
    // cout << cnt << endl;
  }
  //
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
// for(int i = 0;i < num; i++){}
int main() {
  //

  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int num;
  int cnt = 0;
  scanf("%d", &num);
  // cin >> num;

  for (int i = 1; i <= num; i++) {
    cnt = 0;
    for (int x = 1; x <= sqrt(i); x++) {
      if (pow(x, 2) + x > i)
        break;
      for (int y = 1; y <= sqrt(i); y++) {
        if (pow(x, 2) + pow(y, 2) + x * y + x + y > i)
          break;
        for (int z = 1; z <= sqrt(i); z++) {
          if (pow(x, 2) + pow(y, 2) + pow(z, 2) + x * y + y * z + z * x > i)
            break;
          if (pow(x, 2) + pow(y, 2) + pow(z, 2) + x * y + y * z + z * x == i)
            cnt++;
        }
      }
    }
    printf("%d\\n", cnt);
    // cout << cnt << endl;
  }
  //
}
Problem p02608 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> ans(100000, 0);

  for (int i = 1; i <= sqrt(n); i++) {
    for (int j = 1; j <= sqrt(n); j++) {
      for (int k = 1; k <= sqrt(n); k++) {
        int f = i * i + j * j + k * k + i * j + j * k + k * i - 1;
        ans[f]++;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << endl;
  }
}

Error: -6
malloc(): corrupted top size


Fixed submission:

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> ans(n, 0);

  for (int i = 1; i <= sqrt(n); i++) {
    for (int j = 1; j <= sqrt(n); j++) {
      for (int k = 1; k <= sqrt(n); k++) {
        int f = i * i + j * j + k * k + i * j + j * k + k * i - 1;
        ans[f]++;
      }
    }
  }

  for (int i = 0; i < n; i++) {
    cout << ans[i] << endl;
  }
}
Problem p02608 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <cmath>
#include <iostream>
#include <iterator>
#include <map>
#include <set>
#include <string>
#include <unordered_map>
using namespace std;

int main() {
  int N, i, x, y, z, sq, count;
  cin >> N;
  for (i = 1; i <= N; i += 1) {
    count = 0;
    sq = (int)pow(i, 0.5);
    for (x = 1; x <= sq; x += 1) {
      for (y = 1; y <= sq; y += 1) {
        if (x * x + y * y > i) {
          break;
        }
        for (z = 1; z <= sq; z += 1) {
          if (x * x + y * y + z * z + x * y + y * z + z * x > i) {
            break;
          }
          if (x * x + y * y + z * z + x * y + y * z + z * x == i) {
            count += 1;
          }
        }
      }
    }
    cout << count << endl;
  }
}


Error: TLE

Fixed submission:

#include <algorithm>
#include <cmath>
#include <iostream>
#include <iterator>
#include <map>
#include <set>
#include <string>
#include <unordered_map>
using namespace std;

int main() {
  int N, i, x, y, z, sq, count;
  cin >> N;
  for (i = 1; i <= N; i += 1) {
    count = 0;
    sq = (int)pow(i, 0.5);
    for (x = 1; x <= sq; x += 1) {
      for (y = 1; y <= sq; y += 1) {
        for (z = 1; z <= sq; z += 1) {
          if (x * x + y * y + z * z + x * y + y * z + z * x == i) {
            count += 1;
          }
        }
      }
    }
    cout << count << endl;
  }
}
Problem p02608 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;
typedef long long int ll;

int main() {
  int N;
  cin >> N;
  for (int n = 1; n <= N; n++) {
    ll ans = 0;
    for (int x = 1; x <= 100; x++) {
      for (int y = 1; y <= 100; y++) {
        double dx, dy, dn;
        dx = x;
        dy = y;
        dn = n;
        double dz = sqrt(dn - (dx * dx + dy * dy + dx * dy) +
                         ((dx + dy) / 2) * ((dx + dy) / 2)) -
                    (dx + dy) / 2;
        int z = dz;
        if (x * x + y * y + z * z + x * y + y * z + z * x == n && z >= 1) {
          ans++;
          // cout<<n<<" "<<x*x + y*y + z*z + x*y + y*z + z*x<<endl;
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;
typedef long long int ll;

int main() {
  int N;
  cin >> N;
  for (int i = 1; i <= N; i++) {
    ll ans = 0;
    for (int x = 1; x <= 100; x++) {
      for (int y = 1; y <= 100; y++) {
        for (int z = 1; z <= 100; z++) {
          if (x * x + y * y + z * z + x * y + y * z + z * x == i)
            ans++;
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}
Problem p02608 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <cmath>
#include <cstdio>
using namespace std;

int main() {
  int n, cnt = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int a, b, c;
    for (a = -sqrt(2 * i); a <= sqrt(2 * i); a++) {
      for (b = -sqrt(2 * i); b <= sqrt(2 * i); b++) {
        if ((int)sqrt(2 * i - a * a - b * b) == sqrt(2 * i - a * a - b * b)) {
          c = sqrt(2 * i - a * a - b * b);
          if ((a - b) + c >= 2 && (b - c) + a >= 2 && (b - a) + c >= 2) {
            cnt++;
          }
        }
      }
    }
    printf("%d\\n", cnt);
    cnt = 0;
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <cmath>
#include <cstdio>
using namespace std;

int main() {
  int n, cnt = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int x, y, z;
    for (x = 1; x <= sqrt(i); x++) {
      for (y = 1; y <= sqrt(i); y++) {
        for (z = 1; z <= sqrt(i); z++) {
          if (x * x + y * y + z * z + x * y + y * z + z * x == i) {
            cnt++;
          }
        }
      }
    }
    printf("%d\\n", cnt);
    cnt = 0;
  }

  return 0;
}
Problem p02608 (C++) — buggy submission, verdict: Runtime Error

#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

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;
}

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

// -------------------------------------------------------

ll N;
ll ans[10101];

int main() {
  //
  cin >> N;
  for (ll i = 1; i * i <= N; ++i) {
    for (ll j = 1; j * j <= N; ++j) {
      for (ll k = 1; k * k <= N; ++k) {
        ll sum = i * i + j * j + k * k + i * j + j * k + k * i;
        if (sum > N)
          continue;
        ++ans[sum];
      }
    }
  }
  repe(i, 1, N) { cout << ans[i] << "\\n"; }
}


Error: 0

Fixed submission:

#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

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;
}

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

// -------------------------------------------------------

ll N;
ll ans[10101];

int main() {
  //
  cin >> N;
  for (ll i = 1; i * i <= N; ++i) {
    for (ll j = 1; j * j <= N; ++j) {
      for (ll k = 1; k * k <= N; ++k) {
        ll sum = i * i + j * j + k * k + i * j + j * k + k * i;
        ++ans[sum];
      }
    }
  }
  repe(i, 1, N) { cout << ans[i] << "\\n"; }
}