結果
問題 |
No.2510 Six Cube Sum Counting
|
ユーザー |
|
提出日時 | 2024-06-15 03:49:59 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 504 bytes |
コンパイル時間 | 563 ms |
コンパイル使用メモリ | 82,560 KB |
実行使用メモリ | 1,484,452 KB |
最終ジャッジ日時 | 2024-06-15 03:52:10 |
合計ジャッジ時間 | 117,658 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | TLE * 1 MLE * 3 |
other | TLE * 5 MLE * 21 |
ソースコード
from collections import defaultdict X = int(input()) c_list = defaultdict(list) cnt = defaultdict(int) ans = 0 for c in range(301): for b in range(c+1): for a in range(b+1): T = a**3 + b**3 + c**3 c_list[T].append(c) for d in range(301): for e in range(d, 301): for f in range(e, 301): T = X - d**3 - e**3 - f**3 if T not in c_list: continue while cnt[T] < len(c_list[T]) \ and c_list[T][cnt[T]] <= d: cnt[T] += 1 ans += cnt[T] print(ans)