結果
問題 | No.2510 Six Cube Sum Counting |
ユーザー |
👑 |
提出日時 | 2023-09-22 19:21:26 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 3,231 ms / 4,000 ms |
コード長 | 565 bytes |
コンパイル時間 | 456 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 388,604 KB |
最終ジャッジ日時 | 2024-09-19 12:49:05 |
合計ジャッジ時間 | 92,283 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
外部呼び出し有り |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 26 |
ソースコード
n = int(input())ans = 0cubes = {}for a in range(301):a3 = a * a * afor b in range(a, 301):b3 = b * b * bfor c in range(b, 301):c3 = c * c * cx = a3 + b3 + c3if x not in cubes:cubes[x] = 0cubes[x] <<= 9cubes[x] |= cfor d in range(301):d3 = d * d * dfor e in range(d, 301):e3 = e * e * efor f in range(e, 301):f3 = f * f * fx = d3 + e3 + f3z = n - xif z in cubes:zero = Truew = cubes[z]while w > 0 or zero:if w & 0x1ff <= d:ans += 1w >>= 9zero = Falseprint(ans)