結果

問題 No.1478 Simple Sugoroku
ユーザー taiga000629taiga000629
提出日時 2021-04-16 22:57:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 463 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 87,612 KB
実行使用メモリ 112,872 KB
最終ジャッジ日時 2023-09-16 02:10:40
合計ジャッジ時間 11,501 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,732 KB
testcase_01 AC 70 ms
71,524 KB
testcase_02 AC 73 ms
71,512 KB
testcase_03 AC 71 ms
71,776 KB
testcase_04 AC 72 ms
71,772 KB
testcase_05 AC 70 ms
71,492 KB
testcase_06 AC 71 ms
71,920 KB
testcase_07 AC 73 ms
71,948 KB
testcase_08 AC 71 ms
71,680 KB
testcase_09 AC 70 ms
71,708 KB
testcase_10 AC 69 ms
71,704 KB
testcase_11 AC 71 ms
71,484 KB
testcase_12 AC 71 ms
71,624 KB
testcase_13 AC 305 ms
107,912 KB
testcase_14 AC 320 ms
110,952 KB
testcase_15 AC 305 ms
108,480 KB
testcase_16 AC 306 ms
108,356 KB
testcase_17 AC 307 ms
109,328 KB
testcase_18 AC 320 ms
110,812 KB
testcase_19 AC 307 ms
107,892 KB
testcase_20 AC 305 ms
109,264 KB
testcase_21 AC 308 ms
109,512 KB
testcase_22 AC 305 ms
107,912 KB
testcase_23 AC 302 ms
108,632 KB
testcase_24 AC 305 ms
108,744 KB
testcase_25 AC 305 ms
108,328 KB
testcase_26 AC 305 ms
108,372 KB
testcase_27 AC 306 ms
108,068 KB
testcase_28 AC 375 ms
112,872 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
権限があれば一括ダウンロードができます

ソースコード

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**12
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