結果

問題 No.1478 Simple Sugoroku
ユーザー ayaoniayaoni
提出日時 2021-04-17 04:03:11
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 679 bytes
コンパイル時間 1,033 ms
コンパイル使用メモリ 86,748 KB
実行使用メモリ 92,360 KB
最終ジャッジ日時 2023-09-16 08:25:31
合計ジャッジ時間 7,181 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,184 KB
testcase_01 AC 74 ms
71,420 KB
testcase_02 AC 74 ms
71,284 KB
testcase_03 AC 75 ms
70,916 KB
testcase_04 WA -
testcase_05 AC 75 ms
71,248 KB
testcase_06 AC 76 ms
71,272 KB
testcase_07 AC 75 ms
71,132 KB
testcase_08 AC 75 ms
71,252 KB
testcase_09 AC 77 ms
71,240 KB
testcase_10 AC 77 ms
70,924 KB
testcase_11 AC 75 ms
71,292 KB
testcase_12 AC 75 ms
70,968 KB
testcase_13 AC 105 ms
92,172 KB
testcase_14 AC 102 ms
92,080 KB
testcase_15 AC 102 ms
92,008 KB
testcase_16 AC 107 ms
92,356 KB
testcase_17 AC 104 ms
92,204 KB
testcase_18 AC 102 ms
91,988 KB
testcase_19 AC 105 ms
92,360 KB
testcase_20 AC 105 ms
92,184 KB
testcase_21 AC 105 ms
92,088 KB
testcase_22 AC 104 ms
92,088 KB
testcase_23 AC 103 ms
92,032 KB
testcase_24 AC 105 ms
92,144 KB
testcase_25 AC 105 ms
92,104 KB
testcase_26 AC 104 ms
92,208 KB
testcase_27 AC 104 ms
92,032 KB
testcase_28 AC 100 ms
91,124 KB
testcase_29 AC 102 ms
91,160 KB
testcase_30 AC 103 ms
91,236 KB
testcase_31 AC 103 ms
91,292 KB
testcase_32 AC 103 ms
91,400 KB
testcase_33 AC 103 ms
91,744 KB
testcase_34 AC 102 ms
91,564 KB
testcase_35 AC 101 ms
91,416 KB
testcase_36 AC 102 ms
91,420 KB
testcase_37 AC 102 ms
91,956 KB
testcase_38 AC 103 ms
91,876 KB
testcase_39 AC 102 ms
91,784 KB
testcase_40 AC 103 ms
91,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


N,M = MI()
B = LI()

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

a = B[0]-1
B = [b-a for b in B]
N -= a
a += N-B[-1]

b = 0
ans = 10**18
for i in range(M-1,-1,-1):
    b += B[-1]-B[i]
    ans = min(ans,a+M/(M-i)+b/(M-i))

print(ans)
0