結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,616 KB
testcase_01 AC 73 ms
71,612 KB
testcase_02 AC 73 ms
71,904 KB
testcase_03 AC 74 ms
71,496 KB
testcase_04 AC 74 ms
71,608 KB
testcase_05 AC 72 ms
71,656 KB
testcase_06 AC 71 ms
71,472 KB
testcase_07 AC 73 ms
71,448 KB
testcase_08 AC 72 ms
71,972 KB
testcase_09 AC 76 ms
71,464 KB
testcase_10 AC 74 ms
71,508 KB
testcase_11 AC 75 ms
71,736 KB
testcase_12 AC 73 ms
71,560 KB
testcase_13 AC 460 ms
120,592 KB
testcase_14 AC 440 ms
118,232 KB
testcase_15 AC 445 ms
118,372 KB
testcase_16 AC 445 ms
119,252 KB
testcase_17 AC 455 ms
120,464 KB
testcase_18 AC 454 ms
118,496 KB
testcase_19 AC 458 ms
119,812 KB
testcase_20 AC 464 ms
120,360 KB
testcase_21 AC 451 ms
120,296 KB
testcase_22 AC 453 ms
118,884 KB
testcase_23 AC 457 ms
117,736 KB
testcase_24 AC 453 ms
118,580 KB
testcase_25 AC 455 ms
118,836 KB
testcase_26 AC 451 ms
118,568 KB
testcase_27 AC 463 ms
120,300 KB
testcase_28 AC 405 ms
113,620 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**15
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