結果

問題 No.1478 Simple Sugoroku
ユーザー 小野寺健
提出日時 2021-04-27 13:52:26
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 336 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 29,396 KB
最終ジャッジ日時 2024-07-06 07:46:57
合計ジャッジ時間 5,331 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 WA * 1 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 = float('inf')
for k in range(1, M):
    exp = M / (M-k) + 1 / (M-k) * (B[-1]*(M-k) - sum(B[k:]))
    minExp = min(minExp, exp)
    
if minExp == float('inf'):
    minExp = 0
        
print(float(cnt+minExp))
0