結果

問題 No.472 平均順位
ユーザー juris_lazyjuris_lazy
提出日時 2022-08-04 14:26:57
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 446 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 86,572 KB
実行使用メモリ 803,152 KB
最終ジャッジ日時 2023-10-12 11:58:31
合計ジャッジ時間 10,027 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 MLE -
testcase_01 AC 71 ms
71,268 KB
testcase_02 AC 72 ms
71,168 KB
testcase_03 AC 73 ms
71,196 KB
testcase_04 AC 90 ms
76,564 KB
testcase_05 AC 75 ms
71,176 KB
testcase_06 AC 84 ms
76,408 KB
testcase_07 AC 93 ms
76,272 KB
testcase_08 AC 166 ms
83,740 KB
testcase_09 AC 355 ms
108,560 KB
testcase_10 AC 316 ms
95,392 KB
testcase_11 AC 887 ms
174,684 KB
testcase_12 AC 678 ms
146,980 KB
testcase_13 TLE -
testcase_14 MLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, P = map(int, input().split())
contests = [list(map(int, input().split())) for _ in range(N)]
dp = [[float('inf')] * (P + 1) for _ in range(N + 1)]
dp[0][0] = 0
for i in range(N):
  a = contests[i]
  for j in range(P + 1):
    for k in range(3, -1, -1):
      if k < 3:
        add = a[k]
      else:
        add = 1
      if j + k <= P:
        dp[i + 1][j + k] = min(dp[i + 1][j + k], dp[i][j] + add)
#print(*dp, sep='\n')
print(dp[N][P] / N)
0