結果

問題 No.23 技の選択
ユーザー brthyyjpbrthyyjp
提出日時 2021-11-09 02:32:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 99 ms / 5,000 ms
コード長 335 bytes
コンパイル時間 1,498 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 77,872 KB
最終ジャッジ日時 2023-08-10 22:11:25
合計ジャッジ時間 5,285 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
70,800 KB
testcase_01 AC 63 ms
71,260 KB
testcase_02 AC 67 ms
71,180 KB
testcase_03 AC 74 ms
75,872 KB
testcase_04 AC 71 ms
75,408 KB
testcase_05 AC 70 ms
71,404 KB
testcase_06 AC 68 ms
71,204 KB
testcase_07 AC 67 ms
71,296 KB
testcase_08 AC 67 ms
71,024 KB
testcase_09 AC 99 ms
77,872 KB
testcase_10 AC 69 ms
71,212 KB
testcase_11 AC 68 ms
71,276 KB
testcase_12 AC 69 ms
71,176 KB
testcase_13 AC 71 ms
71,072 KB
testcase_14 AC 70 ms
71,192 KB
testcase_15 AC 68 ms
71,236 KB
testcase_16 AC 67 ms
71,224 KB
testcase_17 AC 65 ms
71,120 KB
testcase_18 AC 67 ms
71,272 KB
testcase_19 AC 64 ms
70,916 KB
testcase_20 AC 66 ms
71,056 KB
testcase_21 AC 67 ms
71,048 KB
testcase_22 AC 69 ms
71,008 KB
testcase_23 AC 67 ms
71,208 KB
testcase_24 AC 67 ms
71,176 KB
testcase_25 AC 68 ms
71,160 KB
testcase_26 AC 66 ms
71,216 KB
testcase_27 AC 67 ms
71,060 KB
testcase_28 AC 66 ms
70,836 KB
testcase_29 AC 66 ms
71,276 KB
testcase_30 AC 67 ms
71,156 KB
testcase_31 AC 67 ms
71,140 KB
testcase_32 AC 66 ms
71,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import io, os
sys.setrecursionlimit(10**9)
input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline

h, a, d = map(int, input().split())

memo = {}
def rec(x):
    if x in memo:
        return memo[x]
    if x <= 0:
        return 0
    res = min(rec(x-a)+1, rec(x-d)+3/2)
    memo[x] = res
    return res
print(rec(h))

0