結果

問題 No.23 技の選択
ユーザー qibqib
提出日時 2023-02-06 10:21:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 85 ms / 5,000 ms
コード長 254 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 76,248 KB
最終ジャッジ日時 2023-09-17 22:10:17
合計ジャッジ時間 4,892 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,112 KB
testcase_01 AC 73 ms
71,164 KB
testcase_02 AC 70 ms
71,316 KB
testcase_03 AC 77 ms
75,896 KB
testcase_04 AC 83 ms
75,992 KB
testcase_05 AC 77 ms
75,844 KB
testcase_06 AC 79 ms
75,764 KB
testcase_07 AC 77 ms
75,816 KB
testcase_08 AC 82 ms
76,088 KB
testcase_09 AC 79 ms
75,844 KB
testcase_10 AC 76 ms
75,756 KB
testcase_11 AC 75 ms
71,176 KB
testcase_12 AC 77 ms
75,836 KB
testcase_13 AC 82 ms
76,012 KB
testcase_14 AC 78 ms
76,248 KB
testcase_15 AC 78 ms
76,196 KB
testcase_16 AC 71 ms
71,344 KB
testcase_17 AC 76 ms
76,120 KB
testcase_18 AC 81 ms
75,912 KB
testcase_19 AC 85 ms
75,752 KB
testcase_20 AC 76 ms
75,768 KB
testcase_21 AC 78 ms
75,704 KB
testcase_22 AC 81 ms
75,772 KB
testcase_23 AC 76 ms
75,812 KB
testcase_24 AC 72 ms
71,020 KB
testcase_25 AC 81 ms
76,076 KB
testcase_26 AC 76 ms
76,064 KB
testcase_27 AC 79 ms
75,916 KB
testcase_28 AC 77 ms
75,808 KB
testcase_29 AC 80 ms
75,792 KB
testcase_30 AC 77 ms
75,760 KB
testcase_31 AC 78 ms
75,844 KB
testcase_32 AC 82 ms
75,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

dp = [1.0e15 for _ in range(h + 1)]
dp[h] = 0.0
for cur in range(h, 0, -1):
  nxt = max(0, cur - a)
  dp[nxt] = min(dp[nxt], dp[cur] + 1.0)
  nxt = max(0, cur - d)
  dp[nxt] = min(dp[nxt], dp[cur] + 1.5)

print(dp[0])
0