結果
問題 |
No.2510 Six Cube Sum Counting
|
ユーザー |
![]() |
提出日時 | 2023-11-30 19:29:13 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 617 bytes |
コンパイル時間 | 1,026 ms |
コンパイル使用メモリ | 93,284 KB |
実行使用メモリ | 336,292 KB |
最終ジャッジ日時 | 2024-09-26 14:27:57 |
合計ジャッジ時間 | 11,489 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | TLE * 1 -- * 3 |
other | -- * 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; }