結果

問題 No.23 技の選択
ユーザー zimphazimpha
提出日時 2017-12-09 02:37:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 103 ms / 5,000 ms
コード長 204 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 78,256 KB
最終ジャッジ日時 2023-09-11 02:53:31
合計ジャッジ時間 4,135 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,356 KB
testcase_01 AC 74 ms
71,112 KB
testcase_02 AC 71 ms
71,360 KB
testcase_03 AC 83 ms
76,176 KB
testcase_04 AC 79 ms
75,656 KB
testcase_05 AC 76 ms
71,640 KB
testcase_06 AC 75 ms
71,328 KB
testcase_07 AC 75 ms
71,180 KB
testcase_08 AC 74 ms
71,016 KB
testcase_09 AC 103 ms
78,256 KB
testcase_10 AC 75 ms
71,296 KB
testcase_11 AC 74 ms
71,372 KB
testcase_12 AC 75 ms
71,552 KB
testcase_13 AC 73 ms
71,300 KB
testcase_14 AC 73 ms
71,360 KB
testcase_15 AC 74 ms
71,288 KB
testcase_16 AC 75 ms
71,284 KB
testcase_17 AC 74 ms
71,076 KB
testcase_18 AC 73 ms
71,184 KB
testcase_19 AC 73 ms
71,568 KB
testcase_20 AC 73 ms
71,160 KB
testcase_21 AC 72 ms
71,116 KB
testcase_22 AC 73 ms
71,424 KB
testcase_23 AC 73 ms
70,996 KB
testcase_24 AC 73 ms
71,288 KB
testcase_25 AC 74 ms
71,484 KB
testcase_26 AC 75 ms
71,148 KB
testcase_27 AC 74 ms
71,360 KB
testcase_28 AC 74 ms
71,480 KB
testcase_29 AC 72 ms
71,608 KB
testcase_30 AC 72 ms
71,060 KB
testcase_31 AC 73 ms
71,296 KB
testcase_32 AC 73 ms
71,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

mem = [-1] * (h + 1)
def dp(c):
  if c <= 0: return 0
  if mem[c] >= 0: return mem[c]
  mem[c] = min(1 + dp(c - a), 1.5 + dp(c - d))
  return mem[c]
print(dp(h))
0