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

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main() {
  ll N;
  cin >> N;
  FOR(i, 1, N + 1) {
    ll cnt = 0;
    FOR(j, 1, 100) {
      FOR(k, 1, 100) {
        FOR(l, 1, 100) {
          if (j * j + k * k + l * l + j * k + k * l + l * j == i) {
            cnt++;
          } else if (j * j + k * k + l * l + j * k + k * l + l * j > i) {
            break;
          }
        }
      }
    }
    cout << cnt << endl;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main() {
  ll N;
  cin >> N;
  FOR(i, 1, N + 1) {
    ll cnt = 0;
    FOR(j, 1, 100) {
      FOR(k, 1, 100) {
        FOR(l, 1, 100) {
          if (j * j + k * k + l * l + j * k + k * l + l * j == i) {
            cnt++;
          }
        }
      }
    }
    cout << cnt << endl;
  }
  return 0;
}
Problem p02608 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int Calc(int x, int y, int z) {
  return (x * x) + (y * y) + (z * z) + (x * y) + (y * z) + (z * x);
}

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

  for (int i = 1; i <= N; i++) {
    int ans = 0;
    int x = 1;
    while (x * x <= i) {
      int y = 1;
      while (y * y <= i) {
        int z = 1;
        while (z * z <= i) {
          int w = Calc(x, y, z);
          if (w == i) {
            ans++;
          } else if (w > i) {
            break;
          }
          z++;
        }
        y++;
      }
      x++;
    }
    cout << ans << endl;
  }

  return 0;
}


Error: TLE

Fixed submission:

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

int Calc(int x, int y, int z) {
  return (x * x) + (y * y) + (z * z) + (x * y) + (y * z) + (z * x);
}

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

  for (int i = 1; i <= N; i++) {
    int ans = 0;
    int x = 1;
    while (x <= i) {
      int y = 1;
      while (y <= i) {
        int z = 1;
        while (z <= i) {
          int w = Calc(x, y, z);
          if (w == i) {
            ans++;
          } else if (w > i) {
            break;
          }
          z++;
        }
        y++;
      }
      x++;
    }
    cout << ans << endl;
  }

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

#include <algorithm>
#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> ans(n + 1);

  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 s = i * i + j * j + k * k + i * j + j * k + i * k;
        if (s > n) {
          break;
        }
        ans[s]++;
      }
    }
  }

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

Error: TLE

Fixed submission:

#include <algorithm>
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;

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

  for (int x = 1; x <= n; x++) {
    int count = 0;
    for (int i = 1; i <= sqrt(x); i++) {
      for (int j = 1; j <= sqrt(x); j++) {
        for (int k = 1; k <= sqrt(x); k++) {
          if (i * i + j * j + k * k + i * j + j * k + i * k == x) {
            count++;
          }
        }
      }
    }

    cout << count << endl;
  }
}
Problem p02608 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
using namespace std;

int main() {
  int n, co = 0;
  bool f = false;
  cin >> n;
  vector<int> ans(n, 0);
  for (int x = 1; x < sqrt(n); ++x) {
    for (int y = 1; y < sqrt(n); ++y) {
      for (int z = 1; z < sqrt(n); ++z) {
        if (x * x + y * y + z * z + x * y + z * x + y * z <= n)
          ans[(x * x + y * y + z * z + x * y + z * x + y * z) - 1]++;
      }
    }
  }
  rep(i, n) { cout << ans[i] << endl; }
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
using namespace std;

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

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

int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int cnt = 0;
    for (int j = 1; j * j <= i; j++) {
      for (int k = j; k * k <= i; k++) {
        for (int l = k; l * l <= i; l++) {
          if (j * j + k * k + l * l + j * k + k * l + l * j == i) {
            if (l == j && j == k && k == l) {
              cnt++;
            } else if (l == j || j == k || l == k) {
              cnt += 3;
            } else {
              cnt += 6;
            }
          }
        }
      }
    }

    cout << cnt << endl;
  }
  return 0;
}

Error: TLE

Fixed submission:

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

int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int cnt = 0;
    for (int j = 1; j * j <= i; j++) {
      for (int k = 1; k * k <= i; k++) {
        for (int l = 1; l * l <= i; l++) {
          if (j * j + k * k + l * l + j * k + k * l + l * j == i) {
            cnt++;
          }
        }
      }
    }

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

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

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

  int n;
  cin >> n;

  int sqrt_n = sqrt(n);
  vector<int> ans(n + 1);
  for (int x = 1; x <= sqrt_n; x++) {
    for (int y = 1; y <= sqrt_n; y++) {
      for (int z = 1; z <= sqrt_n; z++) {
        if (x * x + y * y + z * z + x * y + y * z + z * x <= n)
          ans[x * x + y * y + z * z + x * y + y * z + z * x] += 1;
      }
    }
  }

  for (int i = 1; i < (int)ans.size(); i++)
    cout << ans[i] << '\\n';

  return 0;
}


Error: TLE

Fixed submission:

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

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

  int n;
  cin >> n;

  int sqrt_n = sqrt(n);
  for (int i = 1; i <= n; i++) {
    int cnt = 0;
    for (int x = 1; x <= sqrt_n; x++) {
      if (x * x >= i)
        break;
      for (int y = 1; y <= sqrt_n; y++) {
        if (x * x + y * y + x * y >= i)
          break;
        for (int z = 1; z <= sqrt_n; 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 += 1;
        }
      }
    }

    cout << cnt << '\\n';
  }

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

#include <bits/stdc++.h>

using namespace std;

int ar[100000];

int main() {
  int N;
  cin >> N;
  for (int x = 1; x <= 100; x++) {
    for (int y = 1; y <= 100; y++) {
      for (int z = 1; z <= 100; z++) {

        int val = x * x + y * y + z * z;
        val += x * y + x * z + y * z;
        if (val <= N)
          ar[val]++;
      }
    }
  }
  for (int i = 1; i <= N; i++) {
    cout << ar[i] << "\\n";
  }
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

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

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

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stdio.h>
#include <vector>
#define ll long long
#define IO                                                                     \\
  ios::sync_with_stdio(false);                                                 \\
  cin.tie();                                                                   \\
  cout.tie(0)
using namespace std;
int sum;
int a[1001000];
int main() {
  IO;
  int n;
  cin >> n;
  for (int x = 1; x <= 100; x++)
    for (int y = 1; y <= 100; y++)
      for (int z = 1; z <= 100; z++) {
        a[x * x + y * y + z * z + x * y + x * z + z * y]++;
      }
  for (int i = 1; i <= n; i++) {

    cout << a[i] << endl;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stdio.h>
#include <vector>
#define ll long long
#define IO                                                                     \\
  ios::sync_with_stdio(false);                                                 \\
  cin.tie();                                                                   \\
  cout.tie(0)
using namespace std;
int sum;

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

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(a) (a).begin(), (a).end()
typedef vector<int> vi;
const int INF = 1LL << 60; // 10e18+10e17ちょっとくらい
const int MOD = 1000000007;
const int MAX_N = 200100;

signed main() {
  //  以降 cin の入力元が 'input.txt' になる
  // std::ifstream in("input.txt");
  // std::cin.rdbuf(in.rdbuf());
  int n;
  cin >> n;
  vi ans(n + 1);
  rep(i, n + 1) { ans[i] == 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 <= n)
          ans[x * x + y * y + z * z + x * y + y * z + z * x]++;
      }
    }
  }
  rep(i, n) { cout << ans[i + 1] << endl; }

  return 0;
}

Error: -11

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(a) (a).begin(), (a).end()
typedef vector<int> vi;
const int INF = 1LL << 60; // 10e18+10e17ちょっとくらい
const int MOD = 1000000007;
const int MAX_N = 200100;

signed main() {
  //  以降 cin の入力元が 'input.txt' になる
  // std::ifstream in("input.txt");
  // std::cin.rdbuf(in.rdbuf());
  int n;
  cin >> n;
  vi ans(n + 1);
  rep(i, n + 1) { ans[i] == 0; }
  for (int x = 1; x <= 100; x++) {
    for (int y = 1; y <= 100; y++) {
      for (int z = 1; z <= 100; z++) {
        ans[x * x + y * y + z * z + x * y + y * z + z * x]++;
      }
    }
  }
  rep(i, n) { cout << ans[i + 1] << endl; }

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

#include <bits/stdc++.h>
using namespace std;
int ans[30000];
int main() {
  int n;
  scanf("%d", &n);
  int t = (int)sqrt(n) + 1;
  for (int i = 1; i <= t; i++) {
    for (int j = 1; j <= t; j++) {
      for (int z = 1; z <= t; z++) {
        if (i * i + j * j + z * z + i * j + j * z + i * z <= n)
          ans[i * i + j * j + z * z + i * j + j * z + i * z]++;
      }
    }
  }
  for (int i = 1; i <= n; i++)
    printf("%d\\n", ans[i]);
}

Error: 0

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int ans[30000];
int main() {
  int n;
  scanf("%d", &n);
  int t = (int)sqrt(n) + 1;
  for (int i = 1; i <= t; i++) {
    for (int j = 1; j <= t; j++) {
      for (int z = 1; z <= t; z++) {
        ans[i * i + j * j + z * z + i * j + j * z + i * z]++;
      }
    }
  }
  for (int i = 1; i <= n; i++)
    printf("%d\\n", ans[i]);
}
Problem p02608 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  int e, i, j, k, l, n, count, p, q, z;
  cin >> n;
  z = sqrt(n);
  z = z + 2;
  vector<int> vec(100000);
  for (p = 0; p < 100000; p++) {
    vec.at(p) = 0;
  }

  for (i = 1; i < z; i++) {
    for (j = 1; j < z; j++) {
      for (k = 1; k < z; k++) {
        e = i * i + j * j + k * k + i * j + j * k + k * i;
        vec.at(e) = vec.at(e) + 1;
      }
    }
  }
  for (i = 1; i < n + 1; i++) {
    cout << vec.at(i) << endl;
  }
}

Error: TLE

Fixed submission:

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

int main() {
  int e, i, j, k, l, n, count, p, q, z;
  cin >> n;
  count = 0;
  for (l = 1; l < n + 1; l++) {
    z = sqrt(l);
    z = z + 2;
    for (i = 1; i < z; i++) {
      for (j = 1; j < z; j++) {
        for (k = 1; k < z; k++) {
          e = i * i + j * j + k * k + i * j + j * k + k * i;
          if (l == e) {
            count = count + 1;
          }
          if (l < e) {
            k = z;
          }
        }
      }
    }
    cout << count << endl;
    count = 0;
  }
}
Problem p02608 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;

vector<int> f(int n) {
  int ans = 0;
  int n_sq = ::sqrt(n);
  vector<int> vec(n);

  for (int x = 1; x <= n_sq + 1; x++) {
    for (int y = 1; y <= n_sq + 1; y++) {
      for (int z = 1; z <= n_sq + 1; z++) {
        int v = x * x + y * y + z * z + x * y + y * z + z * x;
        if (v <= n)
          vec[v] += 1;
      }
    }
  }
  return vec;
}

int main() {
  // 制約見て！！！デカかったらlong longにすること！
  int n;
  cin >> n;

  vector<int> vec = f(n);
  rep(i, n) cout << vec[i + 1] << endl;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;

long f(int n) {
  int ans = 0;
  int n_sq = ::sqrt(n);
  for (int x = 1; x <= n_sq + 1; x++) {
    for (int y = 1; y <= n_sq + 1; y++) {
      for (int z = 1; z <= n_sq + 1; z++) {
        if ((x * x + y * y + z * z + x * y + y * z + z * x) == n) {
          ans++;
        }
      }
    }
  }
  return ans;
}

int main() {
  // 制約見て！！！デカかったらlong longにすること！
  int n;
  cin >> n;

  rep(i, n) { cout << f(i + 1) << endl; }
}
Problem p02608 (C++) — buggy submission, verdict: Time Limit Exceeded

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

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

  vector<int> ans(1000000, 0);

  for (int i = 1; i <= 100; i++) {
    for (int j = 1; j <= 100; j++) {
      for (int k = 1; k <= 100; k++) {
        int num = i * i + j * j + k * k + i * j + j * k + k * i;
        ans.at(num) += 1;
      }
    }
  }

  for (int i = 1; i <= n; i++)
    cout << ans.at(i) << endl;
}

Error: TLE

Fixed submission:

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

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

  int ans = 0;
  int m = 1;
  while (n >= m) {
    ans = 0;
    for (int i = 1; i <= 100; i++) {
      for (int j = 1; j <= 100; j++) {
        for (int k = 1; k <= 100; k++) {
          if (i * i + j * j + k * k + i * j + j * k + k * i == m)
            ans++;
        }
      }
    }

    cout << ans << endl;
    m++;
  }
}
Problem p02608 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <cmath>
#include <iostream>
using namespace std;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int counter = 0;
    int limit = sqrt(i);
    for (int x = 1; x < limit; x++) {
      for (int y = x; y < limit; y++) {
        for (int z = y; z < limit; z++) {
          if (x * x + y * y + z * z + x * y + y * z + z * x == i) {
            int weight = 6;
            if (x == y && y == z) {
              weight = 1;
            } else if (x == y || y == z) {
              weight = 3;
            }
            counter += weight;
          }
        }
      }
    }
    cout << counter << endl;
  }
  return 0;
}


Error: TLE

Fixed submission:

#include <cmath>
#include <iostream>
using namespace std;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int counter = 0;
    int limit = sqrt(i);
    for (int x = 1; x < limit; x++) {
      for (int y = 1; y < limit; y++) {
        for (int z = 1; z < limit; z++) {
          if (x * x + y * y + z * z + x * y + y * z + z * x == i) {
            counter++;
          }
        }
      }
    }
    cout << counter << endl;
  }
  return 0;
}
Problem p02608 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>

using namespace std;

int main() {
  int n, ans;
  cin >> n;
  for (int index = 0; index < n; index++) {
    ans = 0;
    for (int i = 1; i < 100; i++) {
      for (int j = i; j < 100; j++) {
        for (int k = j; k < 100; k++) {
          if (i * i + j * j + k * k + i * j + j * k + k * i == index + 1) {
            if (i != j && j != k)
              ans += 6;
            else if ((i == j || i == k || j == k) && !(i == j && i == k))
              ans += 3;
            else if (i == j && i == k)
              ans++;
          }
        }
      }
    }
    printf("%d\\n", ans);
  }

  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  int n, ans;
  cin >> n;
  for (int index = 0; index < n; index++) {
    ans = 0;
    for (int i = 1; i < 75; i++) {
      for (int j = 1; j < 75; j++) {
        for (int k = 1; k < 75; k++) {
          if (i * i + j * j + k * k + i * j + j * k + k * i == index + 1)
            ans++;
        }
      }
    }
    printf("%d\\n", ans);
  }

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

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = (ll)(n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define FORD(i, a, b) for (ll i = (a); i >= (b); i--)
#define ALL(x) (x).begin(), (x).end() // sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size())      // sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1001001001
#define MOD 10000007
#define PB push_back
#define MP make_pair
#define F first
#define S second
int main() {
  int n;
  cin >> n;
  REP(i, n) {
    int cnt = 0;
    for (int x = 0; x < 100; x++)
      for (int y = x; y < 100; y++)
        for (int z = y; z < 100; z++) {
          int reg = (x + 1) * (x + 1) + (y + 1) * (y + 1) + (z + 1) * (z + 1) +
                    (x + 1) * (y + 1) + (y + 1) * (z + 1) + (z + 1) * (x + 1);
          if (reg > i + 1)
            break;
          if (reg == i + 1) {
            if ((x == y) && (y == z) && (z == x))
              cnt++;
            else if ((x != y) && (y != z) && (z != x))
              cnt += 6;
            else
              cnt += 3;
          }
        }
    cout << cnt << endl;
  }
}

Error: TLE

Fixed submission:

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = (ll)(n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define FORD(i, a, b) for (ll i = (a); i >= (b); i--)
#define ALL(x) (x).begin(), (x).end() // sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size())      // sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1001001001
#define MOD 10000007
#define PB push_back
#define MP make_pair
#define F first
#define S second
int main() {
  int n;
  cin >> n;
  REP(i, n) {
    int cnt = 0;
    //        for(int x=0; x<100; x++) for(int y=0; y<100; y++) for(int z=0;
    //        z<100; z++){
    REP(x, n) REP(y, n) REP(z, n) {
      int reg = (x + 1) * (x + 1) + (y + 1) * (y + 1) + (z + 1) * (z + 1) +
                (x + 1) * (y + 1) + (y + 1) * (z + 1) + (z + 1) * (x + 1);
      if (reg > i + 1)
        break;
      if (reg == (i + 1))
        cnt++;
    }

    cout << cnt << endl;
  }
}
Problem p02608 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<int, int>;

int main(void) {
  int N;
  cin >> N;
  vector<int> ans(200000);
  for (int x = 1; x <= 101; x++) {
    for (int y = 1; y <= 101; y++) {
      for (int z = 1; z <= 101; z++) {
        int tmp = x * x + y * y + z * z + x * y + y * z + z * x;
        ans[tmp]++;
      }
    }
  }
  for (int i = 1; i <= N; i++) {
    cout << ans[i] << endl;
  }
  return 0;
}

Error: -11

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<int, int>;

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

#include <cmath>
#include <iostream>
using namespace std;
#define ll long long int
#define fastio                                                                 \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
bool is_integer(double k) { return std::floor(k) == k; }

int main() {

  fastio;
  ll n;
  cin >> n;
  ll index = 1;
  ll t = n;
  while (t--) {
    ll x = sqrt(index);
    ll num;

    ll cnt = 0;
    for (int i = 1; i <= x; i++) {
      for (int j = 1; j <= x; j++) {

        double discriminant =
            ((i + j) * (i + j)) - 4 * (((i * i) + (j * j) + (i * j)) - index);
        if (discriminant <= 0)
          continue;
        if (!is_integer(sqrt(discriminant)))
          continue;
        num = (sqrt(discriminant) - (i + j)) / 2;

        if (num >= 1) {

          cnt++;
        }
      }
    }

    index++;

    cout << cnt << endl;
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <cmath>
#include <iostream>
using namespace std;
#define ll long long int
#define fastio                                                                 \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);

int main() {

  fastio;
  ll n;
  cin >> n;
  ll index = 1;
  ll t = n;
  while (t--) {
    ll x = sqrt(index);

    ll cnt = 0;
    for (int i = 1; i <= x; i++) {
      for (int j = 1; j <= x; j++) {
        for (int k = 1; k <= x; k++) {

          ll number =
              ((i * i) + (j * j) + (k * k)) + ((i * k) + (i * j) + (j * k));
          if (number == index)
            cnt++;
        }
      }
    }
    index++;

    cout << cnt << endl;
  }
  return 0;
}