結果
| 問題 |
No.2510 Six Cube Sum Counting
|
| コンテスト | |
| ユーザー |
chro_96
|
| 提出日時 | 2023-10-20 21:43:33 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,002 bytes |
| コンパイル時間 | 214 ms |
| コンパイル使用メモリ | 30,208 KB |
| 実行使用メモリ | 112,512 KB |
| 最終ジャッジ日時 | 2024-09-20 17:54:03 |
| 合計ジャッジ時間 | 5,863 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 TLE * 1 -- * 1 |
| other | -- * 26 |
ソースコード
#include <stdio.h>
int main () {
int x = 0;
int res = 0;
int ans = 0;
int flag[27000001] = {};
int pow[301] = {};
res = scanf("%d", &x);
for (int i = 0; i <= 300; i++) {
pow[i] = i*i*i;
flag[pow[i]] = 1;
}
for (int f = 300; f >= 0; f--) {
int tmp1 = pow[f];
if (tmp1 <= x) {
for (int e = f; e >= 0; e--) {
int tmp2 = tmp1+pow[e];
if (tmp2 <= x) {
for (int d = e; d >= 0; d--) {
int tmp3 = tmp2+pow[d];
if (tmp3 <= x) {
for (int c = d; c >= 0; c--) {
int tmp4 = tmp3+pow[c];
if (tmp4 <= x) {
for (int b = c; b >= 0; b--) {
int tmp = tmp4+pow[b];
if (tmp <= x && x-tmp <= pow[b]) {
ans += flag[x-tmp];
}
}
}
}
}
}
}
}
}
}
printf("%d\n", ans);
return 0;
}
chro_96