結果

問題 No.1478 Simple Sugoroku
ユーザー toyuzuko
提出日時 2021-04-17 18:00:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 306 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 82,856 KB
実行使用メモリ 96,896 KB
最終ジャッジ日時 2024-07-04 01:09:37
合計ジャッジ時間 5,177 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

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

cum = [0]

for i in range(M):
    cum.append(cum[-1] + B[i])

res = N - 1

for i in range(M - 1):
    cnt = B[0] - 1
    cnt += 1 / (1 - (i + 1) / M)
    cnt += N - (cum[M] - cum[i + 1]) / (M - i - 1)
    res = min(res, cnt)

print(res)
0