結果

問題 No.472 平均順位
ユーザー h_nosonh_noson
提出日時 2017-02-03 21:03:00
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 388 bytes
コンパイル時間 1,004 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 82,712 KB
最終ジャッジ日時 2023-08-25 18:29:04
合計ジャッジ時間 8,990 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,124 KB
testcase_01 AC 64 ms
71,284 KB
testcase_02 AC 66 ms
71,376 KB
testcase_03 AC 62 ms
71,224 KB
testcase_04 AC 76 ms
76,604 KB
testcase_05 AC 67 ms
71,256 KB
testcase_06 AC 76 ms
76,380 KB
testcase_07 AC 80 ms
76,668 KB
testcase_08 AC 135 ms
78,028 KB
testcase_09 AC 265 ms
78,512 KB
testcase_10 AC 211 ms
78,040 KB
testcase_11 AC 605 ms
78,048 KB
testcase_12 AC 447 ms
77,872 KB
testcase_13 AC 1,491 ms
78,000 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

INF = 1e9
n,p = map(int,input().split())
dp = [[INF]*(p+1),[INF]*(p+1)]
dp[0][p] = 0
for i in range(n):
    abc = list(map(int,input().split()))
    abc.append(1)
    for j in range(p+1):
        dp[(i+1)%2][j] = INF
    for j in range(p+1):
        for k in range(4):
            if j >= k:
                dp[(i+1)%2][j-k] = min(dp[(i+1)%2][j-k],dp[i%2][j] + abc[k])
print(dp[n%2][0]/n)
0