結果

問題 No.1478 Simple Sugoroku
ユーザー oteraotera
提出日時 2021-03-12 16:20:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 149 ms / 2,000 ms
コード長 323 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 21,920 KB
最終ジャッジ日時 2024-04-22 03:47:11
合計ジャッジ時間 6,532 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,880 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 29 ms
10,752 KB
testcase_03 AC 27 ms
10,624 KB
testcase_04 AC 27 ms
10,752 KB
testcase_05 AC 26 ms
10,752 KB
testcase_06 AC 26 ms
10,752 KB
testcase_07 AC 27 ms
10,752 KB
testcase_08 AC 27 ms
10,752 KB
testcase_09 AC 27 ms
10,880 KB
testcase_10 AC 26 ms
10,752 KB
testcase_11 AC 25 ms
10,752 KB
testcase_12 AC 26 ms
10,752 KB
testcase_13 AC 144 ms
21,664 KB
testcase_14 AC 144 ms
21,616 KB
testcase_15 AC 148 ms
21,920 KB
testcase_16 AC 149 ms
21,748 KB
testcase_17 AC 142 ms
21,748 KB
testcase_18 AC 146 ms
21,584 KB
testcase_19 AC 143 ms
21,640 KB
testcase_20 AC 143 ms
21,624 KB
testcase_21 AC 146 ms
21,876 KB
testcase_22 AC 146 ms
21,632 KB
testcase_23 AC 146 ms
21,636 KB
testcase_24 AC 145 ms
21,640 KB
testcase_25 AC 142 ms
21,636 KB
testcase_26 AC 140 ms
21,636 KB
testcase_27 AC 145 ms
21,636 KB
testcase_28 AC 141 ms
20,648 KB
testcase_29 AC 139 ms
20,856 KB
testcase_30 AC 148 ms
20,852 KB
testcase_31 AC 144 ms
20,808 KB
testcase_32 AC 142 ms
20,984 KB
testcase_33 AC 146 ms
20,840 KB
testcase_34 AC 148 ms
20,964 KB
testcase_35 AC 141 ms
20,832 KB
testcase_36 AC 142 ms
20,840 KB
testcase_37 AC 144 ms
21,468 KB
testcase_38 AC 146 ms
21,336 KB
testcase_39 AC 144 ms
21,316 KB
testcase_40 AC 148 ms
21,340 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
b = list(map(int, input().split()))

if m == 1:
    print(n - 1)
else:
    ans = float(b[-1] - b[0])
    sum = 0.0
    for i in range(m - 1):
        sum += b[-1] - b[m - 1 - i]
        ans = min(ans, (sum + m) / float(i + 1))
    ans += b[0] + n - 1 - b[-1]
    print("{:.8f}".format(ans))
0