結果

問題 No.472 平均順位
ユーザー すフすフ
提出日時 2022-09-18 18:22:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 598 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 10,824 KB
実行使用メモリ 42,912 KB
最終ジャッジ日時 2023-08-23 18:16:10
合計ジャッジ時間 6,602 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
12,256 KB
testcase_01 AC 14 ms
7,724 KB
testcase_02 AC 14 ms
7,744 KB
testcase_03 AC 16 ms
7,888 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
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