結果

問題 No.472 平均順位
ユーザー rlangevinrlangevin
提出日時 2023-10-20 12:20:01
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 420 bytes
コンパイル時間 1,301 ms
コンパイル使用メモリ 81,348 KB
実行使用メモリ 107,880 KB
最終ジャッジ日時 2023-10-20 12:20:10
合計ジャッジ時間 6,789 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
60,444 KB
testcase_01 AC 38 ms
53,436 KB
testcase_02 AC 39 ms
53,432 KB
testcase_03 AC 39 ms
53,432 KB
testcase_04 AC 48 ms
61,908 KB
testcase_05 AC 39 ms
53,432 KB
testcase_06 AC 47 ms
61,712 KB
testcase_07 AC 51 ms
63,956 KB
testcase_08 AC 89 ms
75,656 KB
testcase_09 AC 170 ms
75,704 KB
testcase_10 AC 130 ms
75,656 KB
testcase_11 AC 401 ms
76,404 KB
testcase_12 AC 302 ms
76,068 KB
testcase_13 AC 955 ms
77,860 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

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 i in range(P + 1):
        for j in range(4):
            if i - j < 0:
                continue
            dp[i] = min(dp[i], pre[i - j] + L[j])

    pre, dp = dp, pre

print(pre[-1]/N)
0