結果

問題 No.1478 Simple Sugoroku
ユーザー taiga000629taiga000629
提出日時 2021-04-16 22:49:42
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 465 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 87,512 KB
実行使用メモリ 274,760 KB
最終ジャッジ日時 2023-09-16 01:59:16
合計ジャッジ時間 5,323 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,416 KB
testcase_01 AC 68 ms
71,824 KB
testcase_02 AC 69 ms
71,892 KB
testcase_03 AC 68 ms
71,752 KB
testcase_04 AC 74 ms
71,620 KB
testcase_05 AC 70 ms
71,600 KB
testcase_06 AC 68 ms
71,900 KB
testcase_07 AC 69 ms
71,992 KB
testcase_08 AC 68 ms
71,964 KB
testcase_09 AC 67 ms
71,652 KB
testcase_10 AC 67 ms
71,648 KB
testcase_11 AC 70 ms
72,032 KB
testcase_12 AC 70 ms
71,800 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
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=-1
ma=10**11
while ma-mi>10**(-9):
    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