結果

問題 No.1478 Simple Sugoroku
ユーザー ygd.ygd.
提出日時 2021-04-16 21:16:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 547 bytes
コンパイル時間 261 ms
コンパイル使用メモリ 87,116 KB
実行使用メモリ 93,496 KB
最終ジャッジ日時 2023-09-15 23:11:41
合計ジャッジ時間 5,989 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,272 KB
testcase_01 AC 72 ms
71,312 KB
testcase_02 AC 72 ms
71,284 KB
testcase_03 AC 71 ms
71,264 KB
testcase_04 AC 72 ms
71,320 KB
testcase_05 AC 73 ms
71,332 KB
testcase_06 AC 72 ms
71,328 KB
testcase_07 AC 71 ms
71,428 KB
testcase_08 AC 72 ms
71,420 KB
testcase_09 AC 75 ms
71,368 KB
testcase_10 AC 73 ms
71,424 KB
testcase_11 AC 73 ms
70,992 KB
testcase_12 AC 72 ms
71,280 KB
testcase_13 AC 102 ms
93,336 KB
testcase_14 AC 102 ms
93,252 KB
testcase_15 AC 100 ms
93,496 KB
testcase_16 AC 101 ms
93,480 KB
testcase_17 AC 102 ms
93,424 KB
testcase_18 AC 102 ms
93,228 KB
testcase_19 AC 101 ms
93,312 KB
testcase_20 AC 102 ms
93,356 KB
testcase_21 AC 100 ms
93,408 KB
testcase_22 AC 103 ms
93,448 KB
testcase_23 AC 102 ms
93,360 KB
testcase_24 AC 102 ms
93,480 KB
testcase_25 AC 102 ms
93,364 KB
testcase_26 AC 102 ms
93,352 KB
testcase_27 AC 101 ms
93,208 KB
testcase_28 AC 97 ms
92,036 KB
testcase_29 AC 117 ms
92,588 KB
testcase_30 AC 117 ms
92,592 KB
testcase_31 AC 115 ms
92,524 KB
testcase_32 AC 117 ms
92,408 KB
testcase_33 AC 98 ms
92,448 KB
testcase_34 AC 100 ms
92,552 KB
testcase_35 AC 98 ms
92,464 KB
testcase_36 AC 99 ms
92,412 KB
testcase_37 AC 101 ms
93,184 KB
testcase_38 AC 102 ms
93,008 KB
testcase_39 AC 99 ms
92,856 KB
testcase_40 AC 101 ms
93,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,input().split())
B = list(map(int,input().split()))
PB = [-1]*M
S = 0
cnt = 0
for i in reversed(range(M)):
    if i == M-1:
        PB[i] = N - B[i]
        S += PB[i]
        cnt += 1
    else:
        p_walk = PB[i+1] + (B[i+1] - B[i]) #ワープしない場合
        p_warp = (S+M)*(M-cnt)/(cnt*(M-cnt))
        #print(i,S,M-cnt,p_walk,p_warp)
        if p_walk < p_warp:
            PB[i] = p_walk
            S += PB[i]
            cnt += 1
        else:
            PB[i] = p_warp
#print(PB)
ans = PB[0] + B[0] - 1
print(ans)
0