結果

問題 No.23 技の選択
ユーザー rlangevinrlangevin
提出日時 2023-08-14 23:12:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 50 ms / 5,000 ms
コード長 259 bytes
コンパイル時間 982 ms
コンパイル使用メモリ 82,312 KB
実行使用メモリ 66,176 KB
最終ジャッジ日時 2024-05-02 11:23:12
合計ジャッジ時間 3,415 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
63,360 KB
testcase_01 AC 46 ms
65,152 KB
testcase_02 AC 41 ms
62,080 KB
testcase_03 AC 45 ms
64,240 KB
testcase_04 AC 46 ms
63,104 KB
testcase_05 AC 42 ms
61,696 KB
testcase_06 AC 45 ms
63,616 KB
testcase_07 AC 46 ms
64,640 KB
testcase_08 AC 42 ms
63,360 KB
testcase_09 AC 41 ms
61,980 KB
testcase_10 AC 46 ms
62,720 KB
testcase_11 AC 49 ms
66,176 KB
testcase_12 AC 44 ms
62,208 KB
testcase_13 AC 46 ms
62,848 KB
testcase_14 AC 45 ms
61,952 KB
testcase_15 AC 47 ms
62,592 KB
testcase_16 AC 46 ms
63,232 KB
testcase_17 AC 45 ms
62,976 KB
testcase_18 AC 45 ms
62,976 KB
testcase_19 AC 46 ms
63,744 KB
testcase_20 AC 42 ms
61,440 KB
testcase_21 AC 46 ms
63,360 KB
testcase_22 AC 46 ms
63,488 KB
testcase_23 AC 44 ms
62,848 KB
testcase_24 AC 44 ms
62,720 KB
testcase_25 AC 43 ms
62,848 KB
testcase_26 AC 47 ms
63,616 KB
testcase_27 AC 46 ms
63,744 KB
testcase_28 AC 48 ms
63,488 KB
testcase_29 AC 50 ms
63,360 KB
testcase_30 AC 49 ms
62,848 KB
testcase_31 AC 49 ms
62,208 KB
testcase_32 AC 49 ms
62,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H, A, D = map(int, input().split())
inf = 10 ** 18
M = 20005
dp = [inf] * M
dp[0] = 0
for i in range(1, M):
    if i - A >= 0:
        dp[i] = min(dp[i], dp[i - A] + 1)
    if i - D >= 0:
        dp[i] = min(dp[i], dp[i - D] + 1.5)
        
print(min(dp[H:]))
0