結果

問題 No.1478 Simple Sugoroku
ユーザー brthyyjpbrthyyjp
提出日時 2022-01-29 19:25:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 151 ms / 2,000 ms
コード長 369 bytes
コンパイル時間 338 ms
コンパイル使用メモリ 86,784 KB
実行使用メモリ 102,376 KB
最終ジャッジ日時 2023-08-30 19:09:06
合計ジャッジ時間 9,134 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,332 KB
testcase_01 AC 73 ms
70,984 KB
testcase_02 AC 72 ms
71,420 KB
testcase_03 AC 71 ms
70,984 KB
testcase_04 AC 73 ms
71,160 KB
testcase_05 AC 73 ms
71,244 KB
testcase_06 AC 73 ms
71,284 KB
testcase_07 AC 72 ms
71,352 KB
testcase_08 AC 74 ms
71,356 KB
testcase_09 AC 73 ms
71,204 KB
testcase_10 AC 74 ms
71,180 KB
testcase_11 AC 73 ms
71,236 KB
testcase_12 AC 73 ms
71,148 KB
testcase_13 AC 151 ms
99,060 KB
testcase_14 AC 132 ms
100,300 KB
testcase_15 AC 136 ms
99,020 KB
testcase_16 AC 137 ms
99,008 KB
testcase_17 AC 136 ms
99,532 KB
testcase_18 AC 134 ms
99,376 KB
testcase_19 AC 134 ms
99,196 KB
testcase_20 AC 135 ms
99,064 KB
testcase_21 AC 136 ms
99,296 KB
testcase_22 AC 134 ms
99,180 KB
testcase_23 AC 135 ms
99,124 KB
testcase_24 AC 133 ms
99,100 KB
testcase_25 AC 135 ms
99,012 KB
testcase_26 AC 135 ms
98,956 KB
testcase_27 AC 133 ms
98,956 KB
testcase_28 AC 113 ms
100,008 KB
testcase_29 AC 139 ms
101,576 KB
testcase_30 AC 139 ms
101,800 KB
testcase_31 AC 139 ms
101,848 KB
testcase_32 AC 138 ms
101,752 KB
testcase_33 AC 141 ms
102,028 KB
testcase_34 AC 138 ms
102,272 KB
testcase_35 AC 140 ms
102,196 KB
testcase_36 AC 142 ms
102,376 KB
testcase_37 AC 144 ms
98,848 KB
testcase_38 AC 138 ms
98,856 KB
testcase_39 AC 138 ms
98,872 KB
testcase_40 AC 138 ms
98,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

A = [0]*m
for i, b in enumerate(B):
    A[i] = n-b
C = [0]+A
from itertools import accumulate
C = list(accumulate(C))
ans = float('inf')
for i in range(m):
    y = m*(C[m]-C[i]+i)
    if (m-i)*A[i] <= m*(C[m]-C[i]+i):
        x = y/(m-i)
        ans = min(ans, B[0]-1+min(x/m+1, n-B[0]))
print(ans)
0