結果

問題 No.1478 Simple Sugoroku
ユーザー convexineqconvexineq
提出日時 2021-04-16 20:32:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 252 bytes
コンパイル時間 244 ms
コンパイル使用メモリ 87,264 KB
実行使用メモリ 97,660 KB
最終ジャッジ日時 2023-09-15 21:23:37
合計ジャッジ時間 5,852 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,124 KB
testcase_01 AC 69 ms
71,116 KB
testcase_02 AC 68 ms
71,140 KB
testcase_03 AC 70 ms
71,220 KB
testcase_04 AC 69 ms
71,404 KB
testcase_05 AC 70 ms
71,276 KB
testcase_06 AC 71 ms
71,116 KB
testcase_07 AC 71 ms
71,164 KB
testcase_08 AC 70 ms
71,348 KB
testcase_09 AC 71 ms
70,908 KB
testcase_10 AC 71 ms
71,356 KB
testcase_11 AC 72 ms
71,380 KB
testcase_12 AC 71 ms
71,300 KB
testcase_13 AC 105 ms
96,928 KB
testcase_14 AC 102 ms
96,736 KB
testcase_15 AC 101 ms
96,992 KB
testcase_16 AC 102 ms
97,072 KB
testcase_17 AC 102 ms
96,800 KB
testcase_18 AC 101 ms
96,732 KB
testcase_19 AC 102 ms
96,904 KB
testcase_20 AC 103 ms
96,856 KB
testcase_21 AC 103 ms
96,780 KB
testcase_22 AC 101 ms
96,976 KB
testcase_23 AC 101 ms
97,084 KB
testcase_24 AC 103 ms
96,976 KB
testcase_25 AC 102 ms
97,040 KB
testcase_26 AC 101 ms
96,960 KB
testcase_27 AC 100 ms
97,160 KB
testcase_28 AC 97 ms
95,980 KB
testcase_29 AC 100 ms
96,792 KB
testcase_30 AC 99 ms
96,720 KB
testcase_31 AC 100 ms
97,196 KB
testcase_32 AC 102 ms
96,752 KB
testcase_33 AC 104 ms
97,192 KB
testcase_34 AC 102 ms
97,256 KB
testcase_35 AC 100 ms
97,140 KB
testcase_36 AC 101 ms
97,080 KB
testcase_37 AC 101 ms
97,608 KB
testcase_38 AC 102 ms
97,660 KB
testcase_39 AC 103 ms
97,548 KB
testcase_40 AC 109 ms
97,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
*b, = list(map(int,input().split()))
dp = [0.0]*m
acc = [0.0]*m
dp[-1] = acc[-1] = n-b[-1]
for i in range(m-1)[::-1]:
    dp[i] = min(n-b[i], m/(m-1-i) + acc[i+1]/(m-1-i))
    acc[i] = acc[i+1] + dp[i]
print(dp[0]+b[0]-1)
0