結果
| 問題 | No.2067 ±2^k operations |
| コンテスト | |
| ユーザー |
とりゐ
|
| 提出日時 | 2022-08-30 17:37:56 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 347 ms / 2,000 ms |
| + 50µs | |
| コード長 | 226 bytes |
| 記録 | |
| コンパイル時間 | 62 ms |
| コンパイル使用メモリ | 80,964 KB |
| 実行使用メモリ | 189,892 KB |
| 最終ジャッジ日時 | 2026-09-20 09:39:43 |
| 合計ジャッジ時間 | 6,659 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 23 |
ソースコード
memo={}
def calc(n):
if n<=0:
return 0
if n in memo:
return memo[n]
memo[n]=calc(n//2)+calc((n+3)//4-1)+calc((n+1)//4)+(n+3)//4+(n+1)//4
return memo[n]
for _ in range(int(input())):
print(calc(int(input())))
とりゐ