結果

問題 No.472 平均順位
ユーザー asumo0729asumo0729
提出日時 2020-12-16 13:45:23
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 534 bytes
コンパイル時間 349 ms
コンパイル使用メモリ 81,812 KB
実行使用メモリ 76,020 KB
最終ジャッジ日時 2023-10-20 09:30:41
合計ジャッジ時間 7,824 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,532 KB
testcase_01 AC 40 ms
53,344 KB
testcase_02 AC 40 ms
53,340 KB
testcase_03 AC 40 ms
53,340 KB
testcase_04 AC 54 ms
64,140 KB
testcase_05 AC 40 ms
53,340 KB
testcase_06 AC 50 ms
62,068 KB
testcase_07 AC 55 ms
64,132 KB
testcase_08 AC 103 ms
75,968 KB
testcase_09 AC 221 ms
76,012 KB
testcase_10 AC 175 ms
76,020 KB
testcase_11 AC 500 ms
75,928 KB
testcase_12 AC 372 ms
75,912 KB
testcase_13 AC 1,182 ms
75,956 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
stdin=sys.stdin

ip=lambda: int(sp())
fp=lambda: float(sp())
lp=lambda:list(map(int,stdin.readline().split()))
tp=lambda:tuple(map(int,stdin.readline().split()))
sp=lambda:stdin.readline().rstrip()
yp=lambda:print('Yes')
np=lambda:print('No')

n,p=lp()
inf=float('inf')
dp=[inf for _ in range(p+1)]
dp[0]=0
for _ in range(n):
    now=lp()
    now.append(1)
    for i in  range(p,-1,-1):
        dp[i]+=now[0]
        for j in range(4):
            if i-j>=0:
                dp[i]=min(dp[i-j]+now[j],dp[i])
print(dp[-1]/n)
0