結果
| 問題 | No.2510 Six Cube Sum Counting |
| コンテスト | |
| ユーザー |
vwxyz
|
| 提出日時 | 2023-11-30 19:29:13 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 3,283 ms / 4,000 ms |
| コード長 | 617 bytes |
| 記録 | |
| コンパイル時間 | 1,297 ms |
| コンパイル使用メモリ | 166,600 KB |
| 実行使用メモリ | 347,816 KB |
| 最終ジャッジ日時 | 2026-04-13 16:56:32 |
| 合計ジャッジ時間 | 15,806 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 26 |
ソースコード
#include <iostream>
#include <unordered_map>
using namespace std;
int main() {
const int N = 300;
int X;
cin >> X;
unordered_map<int, int> C;
int ans = 0;
for (int d = 0; d <= N; ++d) {
int c = d;
for (int b = 0; b <= c; ++b) {
for (int a = 0; a <= b; ++a) {
C[a * a * a + b * b * b + c * c * c]++;
}
}
for (int e = d; e <= N; ++e) {
for (int f = e; f <= N; ++f) {
ans += C[X - (d * d * d + e * e * e + f * f * f)];
}
}
}
cout << ans << endl;
return 0;
}
vwxyz