結果
問題 | No.472 平均順位 |
ユーザー |
![]() |
提出日時 | 2020-05-06 09:08:23 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 945 bytes |
コンパイル時間 | 231 ms |
コンパイル使用メモリ | 82,012 KB |
実行使用メモリ | 83,824 KB |
最終ジャッジ日時 | 2024-06-28 03:08:38 |
合計ジャッジ時間 | 7,990 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 9 TLE * 1 -- * 6 |
ソースコード
from itertools import *from bisect import *from collections import *from heapq import *import syssys.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) - 1def 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**16n,p=MI()dp=[inf]*(p+1)dp[0]=0for _ 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()