結果

問題 No.1478 Simple Sugoroku
ユーザー taiga000629taiga000629
提出日時 2021-04-16 22:54:42
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 463 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 87,628 KB
実行使用メモリ 121,532 KB
最終ジャッジ日時 2023-09-16 02:05:13
合計ジャッジ時間 13,464 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,596 KB
testcase_01 AC 73 ms
71,828 KB
testcase_02 AC 70 ms
71,732 KB
testcase_03 AC 69 ms
71,856 KB
testcase_04 AC 69 ms
71,696 KB
testcase_05 AC 70 ms
71,840 KB
testcase_06 AC 70 ms
71,616 KB
testcase_07 AC 68 ms
71,844 KB
testcase_08 AC 69 ms
71,844 KB
testcase_09 AC 70 ms
71,400 KB
testcase_10 AC 72 ms
71,504 KB
testcase_11 AC 72 ms
71,652 KB
testcase_12 AC 70 ms
71,840 KB
testcase_13 AC 474 ms
120,616 KB
testcase_14 AC 465 ms
120,152 KB
testcase_15 AC 467 ms
121,168 KB
testcase_16 AC 465 ms
121,176 KB
testcase_17 AC 470 ms
120,924 KB
testcase_18 AC 473 ms
120,064 KB
testcase_19 AC 474 ms
120,304 KB
testcase_20 AC 469 ms
120,564 KB
testcase_21 AC 465 ms
121,532 KB
testcase_22 AC 472 ms
120,000 KB
testcase_23 AC 472 ms
121,312 KB
testcase_24 AC 473 ms
121,272 KB
testcase_25 AC 482 ms
121,260 KB
testcase_26 AC 482 ms
121,064 KB
testcase_27 AC 484 ms
121,276 KB
testcase_28 AC 422 ms
114,196 KB
testcase_29 TLE -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
b=[-1]+list(map(int,input().split()))
def f(s):
    dp=[10**10]*(m+1)
    dp[m]=n-b[m]
    for i in range(m-1,0,-1):
        dp[i]=min(dp[i+1]+b[i+1]-b[i],s/m+1)
    return sum(dp[i] for i in range(1,m+1))

mi=0
ma=10**20
while ma-mi>10**(-5):
    mid=(ma+mi)/2
    if f(mid)-mid<0:ma=mid
    else:mi=mid

s=ma
dp=[10**10]*(m+1)
dp[m]=n-b[m]
for i in range(m-1,0,-1):
    dp[i]=min(dp[i+1]+b[i+1]-b[i],s/m+1)
print(dp[1]+b[1]-1)





0