結果

問題 No.472 平均順位
ユーザー juris_lazyjuris_lazy
提出日時 2022-08-04 14:40:06
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 417 bytes
コンパイル時間 1,916 ms
コンパイル使用メモリ 86,544 KB
実行使用メモリ 78,796 KB
最終ジャッジ日時 2023-10-12 12:12:41
合計ジャッジ時間 10,455 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,192 KB
testcase_01 AC 69 ms
71,024 KB
testcase_02 AC 70 ms
71,408 KB
testcase_03 AC 70 ms
71,236 KB
testcase_04 AC 89 ms
76,548 KB
testcase_05 AC 72 ms
71,272 KB
testcase_06 AC 84 ms
76,976 KB
testcase_07 AC 93 ms
76,620 KB
testcase_08 AC 162 ms
77,532 KB
testcase_09 AC 367 ms
77,416 KB
testcase_10 AC 285 ms
78,052 KB
testcase_11 AC 935 ms
78,012 KB
testcase_12 AC 693 ms
77,988 KB
testcase_13 TLE -
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]
  for j in range(P, -1, -1):
    tmp = float('inf')
    for k in range(4):
      if k < 3:
        add = a[k]
      else:
        add = 1
      if j - k >= 0:
        tmp = min(tmp, dp[j - k] + add)
    dp[j] = tmp
  #print(dp)
print(dp[P] / N)
0