結果

問題 No.472 平均順位
ユーザー juris_lazyjuris_lazy
提出日時 2022-08-04 14:32:29
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 475 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 105,540 KB
最終ジャッジ日時 2023-10-12 12:05:01
合計ジャッジ時間 8,769 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
78,252 KB
testcase_01 AC 71 ms
71,128 KB
testcase_02 AC 71 ms
71,276 KB
testcase_03 AC 71 ms
71,300 KB
testcase_04 AC 85 ms
76,304 KB
testcase_05 AC 72 ms
71,416 KB
testcase_06 AC 82 ms
76,292 KB
testcase_07 AC 94 ms
76,956 KB
testcase_08 AC 143 ms
77,492 KB
testcase_09 AC 299 ms
77,776 KB
testcase_10 AC 270 ms
78,268 KB
testcase_11 AC 724 ms
79,440 KB
testcase_12 AC 551 ms
78,960 KB
testcase_13 AC 1,828 ms
81,916 KB
testcase_14 TLE -
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)
dp[0] = 0
for i in range(N):
  a = contests[i]
  nxt = [float('inf')] * (P + 1)
  for j in range(P + 1):
    if dp[j] == float('inf'): continue
    for k in range(3, -1, -1):
      if k < 3:
        add = a[k]
      else:
        add = 1
      if j + k <= P:
        nxt[j + k] = min(nxt[j + k], dp[j] + add)
  dp = nxt
  #print(dp)
print(dp[P] / N)
0