結果

問題 No.2416 vs Slime
ユーザー noriocnorioc
提出日時 2023-08-12 14:27:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 193 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 82,400 KB
実行使用メモリ 56,632 KB
最終ジャッジ日時 2024-04-30 06:10:23
合計ジャッジ時間 2,666 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
55,424 KB
testcase_01 AC 43 ms
56,632 KB
testcase_02 AC 40 ms
55,116 KB
testcase_03 AC 40 ms
56,324 KB
testcase_04 AC 37 ms
55,364 KB
testcase_05 AC 39 ms
56,008 KB
testcase_06 AC 40 ms
54,724 KB
testcase_07 AC 38 ms
56,296 KB
testcase_08 AC 41 ms
55,696 KB
testcase_09 AC 39 ms
55,168 KB
testcase_10 AC 39 ms
54,688 KB
testcase_11 AC 37 ms
55,160 KB
testcase_12 AC 39 ms
55,552 KB
testcase_13 AC 38 ms
55,024 KB
testcase_14 AC 38 ms
56,000 KB
testcase_15 AC 39 ms
55,288 KB
testcase_16 AC 38 ms
56,244 KB
testcase_17 AC 38 ms
55,300 KB
testcase_18 AC 39 ms
55,232 KB
testcase_19 AC 39 ms
54,640 KB
testcase_20 AC 38 ms
56,088 KB
testcase_21 AC 38 ms
54,980 KB
testcase_22 AC 38 ms
56,308 KB
testcase_23 AC 37 ms
54,640 KB
testcase_24 AC 38 ms
55,368 KB
testcase_25 AC 39 ms
55,388 KB
testcase_26 AC 38 ms
55,024 KB
testcase_27 AC 38 ms
54,988 KB
testcase_28 AC 39 ms
55,568 KB
testcase_29 AC 39 ms
55,404 KB
testcase_30 AC 40 ms
56,380 KB
testcase_31 AC 42 ms
55,152 KB
testcase_32 AC 40 ms
56,580 KB
testcase_33 AC 39 ms
55,572 KB
testcase_34 AC 39 ms
55,460 KB
testcase_35 AC 39 ms
54,976 KB
testcase_36 AC 38 ms
55,664 KB
testcase_37 AC 38 ms
55,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from functools import lru_cache

H, A = map(int, input().split())


@lru_cache(maxsize=None)
def f(h):
    if h == 0: return 0
    x = h // A
    return f(x) + f(x) + 1


ans = f(H)
print(ans)
0