結果

問題 No.1478 Simple Sugoroku
ユーザー eijiroueijirou
提出日時 2021-04-16 21:36:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 393 bytes
コンパイル時間 2,159 ms
コンパイル使用メモリ 86,728 KB
実行使用メモリ 92,068 KB
最終ジャッジ日時 2023-09-15 23:47:39
合計ジャッジ時間 6,074 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,156 KB
testcase_01 AC 73 ms
71,176 KB
testcase_02 AC 73 ms
71,404 KB
testcase_03 AC 74 ms
71,392 KB
testcase_04 AC 73 ms
71,360 KB
testcase_05 AC 74 ms
71,236 KB
testcase_06 AC 75 ms
71,124 KB
testcase_07 AC 74 ms
71,540 KB
testcase_08 AC 74 ms
71,236 KB
testcase_09 AC 72 ms
71,428 KB
testcase_10 AC 73 ms
71,160 KB
testcase_11 AC 75 ms
71,252 KB
testcase_12 AC 73 ms
71,404 KB
testcase_13 AC 106 ms
91,948 KB
testcase_14 AC 103 ms
91,912 KB
testcase_15 AC 105 ms
91,872 KB
testcase_16 AC 105 ms
91,844 KB
testcase_17 AC 106 ms
91,832 KB
testcase_18 AC 104 ms
91,756 KB
testcase_19 AC 105 ms
91,900 KB
testcase_20 AC 104 ms
91,852 KB
testcase_21 AC 104 ms
91,924 KB
testcase_22 AC 106 ms
92,008 KB
testcase_23 AC 107 ms
91,868 KB
testcase_24 AC 105 ms
92,004 KB
testcase_25 AC 106 ms
91,832 KB
testcase_26 AC 105 ms
91,860 KB
testcase_27 AC 105 ms
92,068 KB
testcase_28 AC 103 ms
90,868 KB
testcase_29 AC 103 ms
91,160 KB
testcase_30 AC 103 ms
91,168 KB
testcase_31 AC 103 ms
90,872 KB
testcase_32 AC 104 ms
90,960 KB
testcase_33 AC 105 ms
91,264 KB
testcase_34 AC 103 ms
91,380 KB
testcase_35 AC 104 ms
91,300 KB
testcase_36 AC 103 ms
91,304 KB
testcase_37 AC 104 ms
91,480 KB
testcase_38 AC 104 ms
91,896 KB
testcase_39 AC 105 ms
91,540 KB
testcase_40 AC 107 ms
91,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n, m = map(int, input().split())
    n = float(n)
    b = list(map(float, input().split()))

    if m == 1:
        print(n - 1.0)
        return

    cumsum = [0.0] * m
    cumsum[m-1] = n - b[m-1]
    for i in range(1, m):
        cnt = m/i + cumsum[m-i]/i
        cumsum[m-i-1] = cumsum[m-i] + min(n-b[m-i-1],cnt)

    print(min(n-1.0, b[0]-1.0+cumsum[0]-cumsum[1]))

main()
0