結果

問題 No.1478 Simple Sugoroku
ユーザー 小野寺健小野寺健
提出日時 2021-04-27 14:01:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 148 ms / 2,000 ms
コード長 314 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 10,740 KB
実行使用メモリ 19,800 KB
最終ジャッジ日時 2023-09-20 12:47:11
合計ジャッジ時間 6,346 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,828 KB
testcase_01 AC 16 ms
7,748 KB
testcase_02 AC 15 ms
7,856 KB
testcase_03 AC 16 ms
7,828 KB
testcase_04 AC 15 ms
7,780 KB
testcase_05 AC 15 ms
7,820 KB
testcase_06 AC 15 ms
7,872 KB
testcase_07 AC 15 ms
7,780 KB
testcase_08 AC 16 ms
7,788 KB
testcase_09 AC 16 ms
7,784 KB
testcase_10 AC 16 ms
7,744 KB
testcase_11 AC 15 ms
7,876 KB
testcase_12 AC 16 ms
7,772 KB
testcase_13 AC 144 ms
18,992 KB
testcase_14 AC 146 ms
18,868 KB
testcase_15 AC 146 ms
18,868 KB
testcase_16 AC 148 ms
18,964 KB
testcase_17 AC 145 ms
19,020 KB
testcase_18 AC 147 ms
18,876 KB
testcase_19 AC 145 ms
18,936 KB
testcase_20 AC 147 ms
18,972 KB
testcase_21 AC 146 ms
18,944 KB
testcase_22 AC 147 ms
18,800 KB
testcase_23 AC 145 ms
18,820 KB
testcase_24 AC 146 ms
18,928 KB
testcase_25 AC 146 ms
18,880 KB
testcase_26 AC 148 ms
18,824 KB
testcase_27 AC 146 ms
18,924 KB
testcase_28 AC 145 ms
19,600 KB
testcase_29 AC 144 ms
19,772 KB
testcase_30 AC 144 ms
19,696 KB
testcase_31 AC 146 ms
19,612 KB
testcase_32 AC 143 ms
19,800 KB
testcase_33 AC 144 ms
19,704 KB
testcase_34 AC 147 ms
19,712 KB
testcase_35 AC 147 ms
19,652 KB
testcase_36 AC 143 ms
19,776 KB
testcase_37 AC 145 ms
18,876 KB
testcase_38 AC 148 ms
18,976 KB
testcase_39 AC 146 ms
18,876 KB
testcase_40 AC 148 ms
18,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

sumB = sum(B)

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

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