結果

問題 No.472 平均順位
ユーザー すフすフ
提出日時 2022-09-18 18:29:39
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 598 bytes
コンパイル時間 1,029 ms
コンパイル使用メモリ 86,496 KB
実行使用メモリ 738,796 KB
最終ジャッジ日時 2023-08-23 18:16:21
合計ジャッジ時間 10,220 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,140 KB
testcase_01 AC 71 ms
71,112 KB
testcase_02 AC 71 ms
71,024 KB
testcase_03 AC 71 ms
71,112 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 TLE -
testcase_14 MLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,p = map(int,input().split())
abc = [list(map(int,input().split()))+[1] for i in range(n)]
inf = float('inf')
#dp[i][j] = i番目まで,解いた数jの時の順位の和の最小値


dp = [[inf]*(max(p+1,4)) for i in range(n)]
dp[0][0] = abc[0][0]
dp[0][1] = abc[0][1]
dp[0][2] = abc[0][2]
dp[0][3] = abc[0][3]
#print(abc)

for i in range(1,n):
    for j in range(p+1):
        for k in range(4):
            if j - k < 0:
                continue
            if dp[i][j]/(i+1) > (dp[i-1][j-k] + abc[i][k])/i:
                dp[i][j] = dp[i-1][j-k] + abc[i][k]
#print(dp)
print(dp[n-1][p]/n)
0