結果

問題 No.1478 Simple Sugoroku
ユーザー taiga000629taiga000629
提出日時 2021-04-16 23:04:42
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 462 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 87,520 KB
実行使用メモリ 277,504 KB
最終ジャッジ日時 2023-09-16 02:24:19
合計ジャッジ時間 11,348 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
76,164 KB
testcase_01 AC 72 ms
71,788 KB
testcase_02 AC 71 ms
71,592 KB
testcase_03 AC 71 ms
71,600 KB
testcase_04 AC 74 ms
71,696 KB
testcase_05 AC 72 ms
71,472 KB
testcase_06 AC 73 ms
71,656 KB
testcase_07 AC 71 ms
71,784 KB
testcase_08 AC 74 ms
71,696 KB
testcase_09 AC 71 ms
71,560 KB
testcase_10 AC 74 ms
71,852 KB
testcase_11 AC 74 ms
71,436 KB
testcase_12 AC 74 ms
71,820 KB
testcase_13 AC 350 ms
112,740 KB
testcase_14 AC 343 ms
112,764 KB
testcase_15 AC 348 ms
113,508 KB
testcase_16 AC 349 ms
113,556 KB
testcase_17 AC 344 ms
113,432 KB
testcase_18 AC 348 ms
113,216 KB
testcase_19 AC 352 ms
112,904 KB
testcase_20 AC 349 ms
112,776 KB
testcase_21 AC 343 ms
113,300 KB
testcase_22 AC 349 ms
113,596 KB
testcase_23 AC 357 ms
113,064 KB
testcase_24 AC 355 ms
112,992 KB
testcase_25 AC 358 ms
113,044 KB
testcase_26 AC 354 ms
113,024 KB
testcase_27 AC 350 ms
112,660 KB
testcase_28 AC 294 ms
108,680 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=n*m+1
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