結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
60,264 KB
testcase_01 AC 37 ms
53,460 KB
testcase_02 AC 38 ms
53,460 KB
testcase_03 AC 37 ms
53,460 KB
testcase_04 AC 48 ms
62,100 KB
testcase_05 AC 39 ms
53,460 KB
testcase_06 AC 47 ms
62,100 KB
testcase_07 AC 53 ms
64,156 KB
testcase_08 AC 92 ms
75,864 KB
testcase_09 AC 180 ms
75,972 KB
testcase_10 AC 148 ms
75,864 KB
testcase_11 AC 412 ms
76,644 KB
testcase_12 AC 350 ms
76,228 KB
testcase_13 AC 1,145 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<<60]*(P+1)
DP[0]=0

for i in range(N):
    A=list(map(int,input().split()))
    A.append(1)
    NDP=[1<<60]*(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