結果

問題 No.472 平均順位
ユーザー h_nosonh_noson
提出日時 2017-02-03 21:02:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 388 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 10,968 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-08-25 18:28:46
合計ジャッジ時間 5,698 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,896 KB
testcase_01 AC 15 ms
7,740 KB
testcase_02 AC 14 ms
7,868 KB
testcase_03 AC 14 ms
7,924 KB
testcase_04 AC 36 ms
7,796 KB
testcase_05 AC 15 ms
7,920 KB
testcase_06 AC 23 ms
7,736 KB
testcase_07 AC 96 ms
7,940 KB
testcase_08 AC 1,421 ms
7,936 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
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