結果

問題 No.1478 Simple Sugoroku
ユーザー 小野寺健
提出日時 2021-04-27 13:56:22
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 286 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 28,740 KB
最終ジャッジ日時 2024-07-06 08:01:36
合計ジャッジ時間 4,549 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 TLE * 1 -- * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())

B = list(map(int, input().split()))

cnt = B[0] - 1 + N - B[-1]

avg = sum(B)/M
W =[]
minExp = B[-1]-B[0]
for k in range(1, M):
    exp = M / (M-k) + 1 / (M-k) * (B[-1]*(M-k) - sum(B[k:]))
    minExp = min(minExp, exp)
        
print(float(cnt+minExp))
0