結果

問題 No.1478 Simple Sugoroku
ユーザー zkouzkou
提出日時 2021-04-16 20:52:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 101 ms / 2,000 ms
コード長 479 bytes
コンパイル時間 1,682 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 92,276 KB
最終ジャッジ日時 2023-09-15 22:13:58
合計ジャッジ時間 6,874 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,300 KB
testcase_01 AC 74 ms
71,480 KB
testcase_02 AC 72 ms
71,384 KB
testcase_03 AC 72 ms
71,348 KB
testcase_04 AC 72 ms
71,460 KB
testcase_05 AC 73 ms
71,380 KB
testcase_06 AC 74 ms
71,364 KB
testcase_07 AC 75 ms
71,300 KB
testcase_08 AC 74 ms
71,240 KB
testcase_09 AC 73 ms
71,344 KB
testcase_10 AC 73 ms
71,348 KB
testcase_11 AC 74 ms
71,148 KB
testcase_12 AC 72 ms
71,332 KB
testcase_13 AC 101 ms
92,152 KB
testcase_14 AC 97 ms
92,024 KB
testcase_15 AC 97 ms
92,048 KB
testcase_16 AC 98 ms
92,044 KB
testcase_17 AC 97 ms
92,056 KB
testcase_18 AC 97 ms
92,016 KB
testcase_19 AC 97 ms
92,160 KB
testcase_20 AC 99 ms
92,120 KB
testcase_21 AC 98 ms
92,056 KB
testcase_22 AC 97 ms
92,164 KB
testcase_23 AC 98 ms
92,276 KB
testcase_24 AC 97 ms
92,128 KB
testcase_25 AC 99 ms
92,220 KB
testcase_26 AC 99 ms
92,148 KB
testcase_27 AC 98 ms
92,128 KB
testcase_28 AC 97 ms
90,912 KB
testcase_29 AC 97 ms
91,276 KB
testcase_30 AC 96 ms
91,224 KB
testcase_31 AC 98 ms
91,560 KB
testcase_32 AC 97 ms
91,552 KB
testcase_33 AC 100 ms
91,552 KB
testcase_34 AC 98 ms
91,644 KB
testcase_35 AC 99 ms
91,656 KB
testcase_36 AC 98 ms
91,532 KB
testcase_37 AC 98 ms
91,976 KB
testcase_38 AC 97 ms
91,940 KB
testcase_39 AC 98 ms
92,044 KB
testcase_40 AC 97 ms
91,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

s = 0
cnt = 0
x = 1001001001001001001
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(min(x + N - Bs[-1] + Bs[0] - 1, N - 1))
0