Submission #15185796
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define contains(v, t) (find(v.begin(), v.end(), t) != v.end())
#define MOD 1000000007
using ll = long long;
using ull = unsigned long long;
using Pii = pair<int, int>;
int main() {
int n; cin >> n;
vector<int> ans(10050);
for(int x = 1; x < 106; x++) {
for(int y = 1; y < 106; y++) {
for(int z = 1; z < 106; z++) {
int t = x * x + y * y + z * z + x * y + y * z + z * x;
if (t < 10050) {
ans[t]++;
}
}
}
}
for(int i = 1; i <= n; i++) {
cout << ans[i] << endl;
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - XYZ Triplets |
| User | kebhr |
| Language | C++ (GCC 9.2.1) |
| Score | 300 |
| Code Size | 657 Byte |
| Status | AC |
| Exec Time | 33 ms |
| Memory | 3624 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt |
| All | hand_01.txt, hand_02.txt, sample_01.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| hand_01.txt | AC | 33 ms | 3504 KiB |
| hand_02.txt | AC | 10 ms | 3624 KiB |
| sample_01.txt | AC | 5 ms | 3556 KiB |