結果

問題 No.23 技の選択
ユーザー mkawa2mkawa2
提出日時 2020-01-06 10:53:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 144 ms / 5,000 ms
コード長 1,042 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 10,852 KB
実行使用メモリ 30,052 KB
最終ジャッジ日時 2023-08-14 22:35:35
合計ジャッジ時間 7,171 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
29,924 KB
testcase_01 AC 133 ms
29,980 KB
testcase_02 AC 130 ms
29,800 KB
testcase_03 AC 144 ms
30,008 KB
testcase_04 AC 138 ms
30,052 KB
testcase_05 AC 140 ms
29,932 KB
testcase_06 AC 136 ms
29,944 KB
testcase_07 AC 134 ms
29,940 KB
testcase_08 AC 135 ms
29,916 KB
testcase_09 AC 137 ms
30,016 KB
testcase_10 AC 134 ms
29,952 KB
testcase_11 AC 132 ms
29,996 KB
testcase_12 AC 138 ms
29,988 KB
testcase_13 AC 135 ms
29,888 KB
testcase_14 AC 132 ms
29,860 KB
testcase_15 AC 134 ms
29,888 KB
testcase_16 AC 128 ms
29,852 KB
testcase_17 AC 133 ms
29,916 KB
testcase_18 AC 133 ms
29,628 KB
testcase_19 AC 134 ms
29,972 KB
testcase_20 AC 129 ms
29,940 KB
testcase_21 AC 129 ms
29,964 KB
testcase_22 AC 133 ms
29,944 KB
testcase_23 AC 130 ms
29,912 KB
testcase_24 AC 129 ms
29,868 KB
testcase_25 AC 137 ms
30,000 KB
testcase_26 AC 130 ms
29,864 KB
testcase_27 AC 136 ms
29,920 KB
testcase_28 AC 140 ms
30,008 KB
testcase_29 AC 136 ms
29,892 KB
testcase_30 AC 137 ms
29,940 KB
testcase_31 AC 136 ms
29,988 KB
testcase_32 AC 137 ms
30,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 6)
from itertools import *
from bisect import *
#from math import *
from collections import *
from heapq import *
from random import *
from decimal import *
import numpy as np

int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
def MF(): return map(float, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LF(): return list(map(float, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
dij = [(0, 1), (1, 0), (0, -1), (-1, 0)]

def main():
    inf=10**6
    h,a,d=MI()
    dp=[inf]*(h+1)
    dp[0]=0
    for i in range(h):
        pre=dp[i]
        ni=min(i+a,h)
        dp[ni]=min(dp[ni],pre+1)
        ni=min(i+d,h)
        dp[ni]=min(dp[ni],pre+1.5)
    print(dp[h])

main()
0