結果

問題 No.472 平均順位
ユーザー mkawa2mkawa2
提出日時 2020-05-06 09:08:23
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 945 bytes
コンパイル時間 478 ms
コンパイル使用メモリ 87,264 KB
実行使用メモリ 83,100 KB
最終ジャッジ日時 2023-09-10 11:48:04
合計ジャッジ時間 8,903 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
78,692 KB
testcase_01 AC 97 ms
71,568 KB
testcase_02 AC 93 ms
71,460 KB
testcase_03 AC 93 ms
71,832 KB
testcase_04 AC 112 ms
77,468 KB
testcase_05 AC 96 ms
71,604 KB
testcase_06 AC 111 ms
77,792 KB
testcase_07 AC 117 ms
77,780 KB
testcase_08 AC 232 ms
78,828 KB
testcase_09 AC 545 ms
78,552 KB
testcase_10 AC 407 ms
78,520 KB
testcase_11 AC 1,401 ms
78,728 KB
testcase_12 AC 1,022 ms
78,632 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import *
from bisect import *
from collections import *
from heapq import *
import sys

sys.setrecursionlimit(10 ** 6)

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def SI(): return sys.stdin.readline()[:-1]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
int1 = lambda x: int(x) - 1
def MI1(): return map(int1, sys.stdin.readline().split())
def LI1(): return list(map(int1, sys.stdin.readline().split()))
p2D = lambda x: print(*x, sep="\n")
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def main():
    inf=10**16
    n,p=MI()
    dp=[inf]*(p+1)
    dp[0]=0
    for _ in range(n):
        rank=LI()+[1]
        for i in range(p,-1,-1):
            dp[i]=min(dp[i-di]+rank[di] for di in range(4) if i-di>=0)

    print(dp[p]/n)

main()
0