結果

問題 No.472 平均順位
ユーザー titiatitia
提出日時 2024-01-08 01:37:03
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 350 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 108,232 KB
最終ジャッジ日時 2024-01-08 01:37:10
合計ジャッジ時間 6,860 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
60,264 KB
testcase_01 AC 36 ms
53,460 KB
testcase_02 AC 35 ms
53,460 KB
testcase_03 AC 37 ms
53,460 KB
testcase_04 AC 46 ms
62,100 KB
testcase_05 AC 36 ms
53,460 KB
testcase_06 AC 49 ms
62,100 KB
testcase_07 AC 47 ms
64,156 KB
testcase_08 AC 84 ms
75,864 KB
testcase_09 AC 184 ms
75,972 KB
testcase_10 AC 143 ms
75,864 KB
testcase_11 AC 408 ms
76,644 KB
testcase_12 AC 326 ms
76,228 KB
testcase_13 AC 1,185 ms
78,020 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N,P=map(int,input().split())

DP=[1<<30]*(P+1)
DP[0]=0

for i in range(N):
    A=list(map(int,input().split()))
    A.append(1)
    NDP=[1<<30]*(P+1)

    for j in range(P+1):
        for k in range(4):
            if j+k<=P:
                NDP[j+k]=min(NDP[j+k],DP[j]+A[k])
    DP=NDP
        
print(DP[P]/N)
0