結果

問題 No.1478 Simple Sugoroku
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-04-16 20:54:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 106 ms / 2,000 ms
コード長 289 bytes
コンパイル時間 449 ms
コンパイル使用メモリ 87,252 KB
実行使用メモリ 93,924 KB
最終ジャッジ日時 2023-09-15 22:15:50
合計ジャッジ時間 6,103 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,372 KB
testcase_01 AC 69 ms
71,388 KB
testcase_02 AC 79 ms
71,256 KB
testcase_03 AC 73 ms
71,192 KB
testcase_04 AC 70 ms
71,372 KB
testcase_05 AC 69 ms
71,152 KB
testcase_06 AC 71 ms
71,140 KB
testcase_07 AC 71 ms
71,176 KB
testcase_08 AC 72 ms
71,352 KB
testcase_09 AC 70 ms
71,076 KB
testcase_10 AC 72 ms
71,068 KB
testcase_11 AC 70 ms
71,420 KB
testcase_12 AC 72 ms
71,444 KB
testcase_13 AC 104 ms
93,420 KB
testcase_14 AC 104 ms
93,592 KB
testcase_15 AC 103 ms
93,816 KB
testcase_16 AC 104 ms
93,828 KB
testcase_17 AC 102 ms
93,752 KB
testcase_18 AC 104 ms
93,924 KB
testcase_19 AC 103 ms
93,824 KB
testcase_20 AC 103 ms
93,484 KB
testcase_21 AC 103 ms
93,628 KB
testcase_22 AC 103 ms
93,512 KB
testcase_23 AC 103 ms
93,400 KB
testcase_24 AC 103 ms
93,684 KB
testcase_25 AC 104 ms
93,760 KB
testcase_26 AC 104 ms
93,808 KB
testcase_27 AC 106 ms
93,396 KB
testcase_28 AC 96 ms
91,200 KB
testcase_29 AC 98 ms
91,320 KB
testcase_30 AC 97 ms
91,276 KB
testcase_31 AC 97 ms
91,328 KB
testcase_32 AC 96 ms
91,296 KB
testcase_33 AC 98 ms
91,572 KB
testcase_34 AC 98 ms
91,612 KB
testcase_35 AC 96 ms
91,536 KB
testcase_36 AC 97 ms
91,872 KB
testcase_37 AC 103 ms
93,456 KB
testcase_38 AC 102 ms
93,376 KB
testcase_39 AC 103 ms
93,608 KB
testcase_40 AC 103 ms
93,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
B = list(map(int,input().split()))
dp = [10**20]*m
dp[-1] = n-B[-1]
cum = dp[-1]
for i in range(m-1)[::-1]:
    dp[i] = B[i+1]-B[i]+dp[i+1]
    cal = m/(m-i-1)+cum/(m-i-1)
    if cal < dp[i]:
        dp[i] = cal
    cum += dp[i]
ans = dp[0]+B[0]-1
print(ans)
0