結果

問題 No.472 平均順位
ユーザー rlangevinrlangevin
提出日時 2023-10-20 12:22:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,910 ms / 2,000 ms
コード長 434 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 81,648 KB
実行使用メモリ 84,956 KB
最終ジャッジ日時 2023-10-20 12:22:52
合計ジャッジ時間 9,237 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,456 KB
testcase_01 AC 41 ms
53,460 KB
testcase_02 AC 40 ms
53,456 KB
testcase_03 AC 41 ms
53,456 KB
testcase_04 AC 59 ms
62,368 KB
testcase_05 AC 44 ms
53,456 KB
testcase_06 AC 47 ms
59,480 KB
testcase_07 AC 53 ms
61,944 KB
testcase_08 AC 70 ms
68,548 KB
testcase_09 AC 119 ms
75,708 KB
testcase_10 AC 95 ms
74,304 KB
testcase_11 AC 238 ms
75,728 KB
testcase_12 AC 189 ms
75,724 KB
testcase_13 AC 532 ms
76,048 KB
testcase_14 AC 1,710 ms
81,780 KB
testcase_15 AC 528 ms
76,048 KB
testcase_16 AC 1,910 ms
83,724 KB
testcase_17 AC 1,692 ms
84,956 KB
testcase_18 AC 182 ms
75,752 KB
testcase_19 AC 282 ms
75,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N, P = map(int, input().split())
inf = 10 ** 18
pre = [inf] * (P + 1)
pre[0] = 0
for _ in range(N):
    dp = [inf] * (P + 1)
    a, b, c = map(int, input().split())
    L = [a, b, c, 1]
    for j in range(4):
        v = L[j]
        for i in range(P + 1):
            if i - j < 0:
                continue
            dp[i] = min(dp[i], pre[i - j] + v)

    pre, dp = dp, pre

print(pre[-1]/N)
0