結果

問題 No.23 技の選択
ユーザー nagitaosu
提出日時 2020-03-13 15:17:15
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 47 ms / 5,000 ms
コード長 295 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-22 04:41:19
合計ジャッジ時間 2,634 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys
input = sys.stdin.readline
INF = 10**9

h, a, d = map(int, input().split())
dp = [INF] * (h + 1)
dp[0] = 0
for i in range(1, h+1):
    # normal
    dp[i] = min(dp[i], dp[max(i-a, 0)] + 1)
    # special
    dp[i] = min(dp[i], dp[max(i-d, 0)] + 1.5)

print(dp[h])
0