結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,460 KB
testcase_01 AC 37 ms
53,460 KB
testcase_02 AC 39 ms
53,460 KB
testcase_03 AC 37 ms
53,460 KB
testcase_04 AC 47 ms
62,104 KB
testcase_05 AC 38 ms
53,460 KB
testcase_06 AC 47 ms
62,096 KB
testcase_07 AC 54 ms
64,184 KB
testcase_08 AC 79 ms
75,740 KB
testcase_09 AC 151 ms
75,752 KB
testcase_10 AC 129 ms
75,740 KB
testcase_11 AC 348 ms
76,356 KB
testcase_12 AC 292 ms
75,988 KB
testcase_13 AC 914 ms
77,636 KB
testcase_14 TLE -
testcase_15 AC 921 ms
77,636 KB
testcase_16 TLE -
testcase_17 TLE -
testcase_18 AC 202 ms
75,972 KB
testcase_19 AC 440 ms
76,264 KB
権限があれば一括ダウンロードができます

ソースコード

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):
        if DP[j]>=(1<<30):
            continue
        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