結果
問題 | No.2510 Six Cube Sum Counting |
ユーザー |
|
提出日時 | 2025-01-08 00:30:42 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 535 bytes |
コンパイル時間 | 1,060 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 863,304 KB |
最終ジャッジ日時 | 2025-01-08 00:32:55 |
合計ジャッジ時間 | 130,128 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 TLE * 1 MLE * 1 |
other | AC * 3 TLE * 20 MLE * 3 |
ソースコード
x = int(input()) m = 301 from collections import Counter import itertools as it lcs = [Counter(a**3 + b**3 for a, b in it.combinations_with_replacement(range(c + 1), 2)) for c in range(m)] rds = [Counter(e**3 + f**3 for e, f in it.combinations_with_replacement(range(d, m), 2)) for d in range(m)] ans = 0 for c, d in it.combinations_with_replacement(range(m), 2): rem = x - c**3 - d**3 if rem < d**3 * 2: continue lc = lcs[c] rd = rds[d] for s, f in lc.items(): ans += f * rd[rem - s] print(ans)