結果

問題 No.2542 Yokan for Two
ユーザー ntudantuda
提出日時 2023-11-25 12:04:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 807 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 335 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 259,088 KB
最終ジャッジ日時 2023-11-25 12:04:48
合計ジャッジ時間 15,842 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,332 KB
testcase_01 AC 38 ms
53,332 KB
testcase_02 AC 38 ms
53,332 KB
testcase_03 AC 173 ms
144,204 KB
testcase_04 AC 199 ms
119,172 KB
testcase_05 AC 562 ms
257,640 KB
testcase_06 AC 38 ms
53,332 KB
testcase_07 AC 807 ms
258,464 KB
testcase_08 AC 307 ms
252,300 KB
testcase_09 AC 753 ms
259,088 KB
testcase_10 AC 129 ms
101,764 KB
testcase_11 AC 160 ms
109,188 KB
testcase_12 AC 478 ms
253,968 KB
testcase_13 AC 114 ms
98,692 KB
testcase_14 AC 354 ms
174,932 KB
testcase_15 AC 485 ms
196,640 KB
testcase_16 AC 420 ms
189,220 KB
testcase_17 AC 374 ms
178,020 KB
testcase_18 AC 460 ms
211,552 KB
testcase_19 AC 230 ms
122,500 KB
testcase_20 AC 188 ms
110,980 KB
testcase_21 AC 210 ms
114,052 KB
testcase_22 AC 237 ms
116,100 KB
testcase_23 AC 224 ms
116,228 KB
testcase_24 AC 38 ms
53,332 KB
testcase_25 AC 38 ms
53,332 KB
testcase_26 AC 38 ms
53,332 KB
testcase_27 AC 43 ms
59,472 KB
testcase_28 AC 45 ms
61,856 KB
testcase_29 AC 256 ms
228,212 KB
testcase_30 AC 369 ms
162,228 KB
testcase_31 AC 346 ms
165,616 KB
testcase_32 AC 342 ms
162,772 KB
testcase_33 AC 375 ms
181,984 KB
testcase_34 AC 456 ms
211,952 KB
testcase_35 AC 461 ms
207,272 KB
testcase_36 AC 459 ms
184,616 KB
testcase_37 AC 469 ms
225,416 KB
testcase_38 AC 454 ms
220,796 KB
testcase_39 AC 524 ms
230,020 KB
testcase_40 AC 471 ms
219,352 KB
testcase_41 AC 496 ms
217,936 KB
testcase_42 AC 447 ms
198,212 KB
testcase_43 AC 464 ms
225,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

L, N = map(int, input().split())
X = list(map(int, input().split())) + [L]
Q = [{X[0]}, set()]

now = X[0]
for x in X[1:]:
    dif = x - now
    Q2 = [set(), set()]
    for j in range(2):
        for q in Q[j]:
            Q2[0].add(q + dif)
            Q2[1].add(q - dif)
    now = x
    Q = Q2
ans = 10 ** 10
for q in Q[1]:
    ans = min(ans, abs(q))
print(ans)
0