結果

問題 No.1478 Simple Sugoroku
ユーザー zkouzkou
提出日時 2021-04-16 20:50:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 489 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 87,236 KB
実行使用メモリ 92,380 KB
最終ジャッジ日時 2023-09-15 22:07:41
合計ジャッジ時間 6,090 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,304 KB
testcase_01 AC 75 ms
71,064 KB
testcase_02 AC 73 ms
71,364 KB
testcase_03 AC 72 ms
71,048 KB
testcase_04 WA -
testcase_05 AC 72 ms
71,436 KB
testcase_06 AC 73 ms
71,148 KB
testcase_07 AC 72 ms
71,432 KB
testcase_08 AC 73 ms
71,512 KB
testcase_09 AC 74 ms
71,304 KB
testcase_10 AC 73 ms
71,324 KB
testcase_11 AC 73 ms
71,100 KB
testcase_12 AC 73 ms
71,500 KB
testcase_13 AC 100 ms
92,236 KB
testcase_14 AC 99 ms
92,144 KB
testcase_15 AC 98 ms
92,244 KB
testcase_16 AC 100 ms
92,284 KB
testcase_17 AC 99 ms
92,244 KB
testcase_18 AC 98 ms
92,020 KB
testcase_19 AC 100 ms
92,260 KB
testcase_20 AC 96 ms
92,276 KB
testcase_21 AC 98 ms
92,084 KB
testcase_22 AC 99 ms
92,304 KB
testcase_23 AC 98 ms
92,320 KB
testcase_24 AC 99 ms
92,380 KB
testcase_25 AC 101 ms
92,268 KB
testcase_26 AC 98 ms
92,308 KB
testcase_27 AC 98 ms
92,288 KB
testcase_28 AC 98 ms
91,192 KB
testcase_29 AC 97 ms
91,264 KB
testcase_30 AC 99 ms
91,184 KB
testcase_31 AC 97 ms
91,488 KB
testcase_32 AC 97 ms
91,464 KB
testcase_33 AC 97 ms
91,676 KB
testcase_34 AC 97 ms
91,804 KB
testcase_35 AC 98 ms
91,460 KB
testcase_36 AC 98 ms
91,660 KB
testcase_37 AC 98 ms
92,116 KB
testcase_38 AC 98 ms
91,956 KB
testcase_39 AC 97 ms
92,060 KB
testcase_40 AC 99 ms
92,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

if M == 1:
    print(N - 1)
    exit()

s = 0
cnt = 0
x = N
for B in Bs[:0:-1]:
    cnt += 1
    s += Bs[-1] - B
    x = min(x, (M + s) / cnt)
    # print((M + s) / cnt)
    
# for _ in range(100):
#     mid = (lo + hi) / 2
#     mid_val = 0
#     for B in Bs:
#         mid_val += min(mid, Bs[-1] - B) + 1
#     if mid * N < mid_val:
#         lo = mid
#     else:
#         hi = mid
print(x + N - Bs[-1] + Bs[0] - 1)
0