結果

問題 No.472 平均順位
ユーザー asumo0729asumo0729
提出日時 2020-12-16 13:48:58
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 607 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 81,636 KB
実行使用メモリ 65,956 KB
最終ジャッジ日時 2023-10-20 09:32:42
合計ジャッジ時間 2,382 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,436 KB
testcase_01 AC 38 ms
53,440 KB
testcase_02 AC 38 ms
53,436 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
権限があれば一括ダウンロードができます

ソースコード

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()
    for i in  range(p,-1,-1):
        dp[i]+=now[0]
        if i-1>=0:
            dp[i]=min(dp[i-1]+now[1],dp[i])
        if i-2>=0:
            dp[i]=min(dp[i-2]+now[2],dp[i])
        if i-3>=0:
            dp[i]=min(dp[i-3]+now[3],dp[i])
print(dp[-1]/n)
0