結果

問題 No.2542 Yokan for Two
ユーザー 👑 p-adicp-adic
提出日時 2023-08-10 19:15:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 543 ms / 2,000 ms
コード長 220 bytes
コンパイル時間 312 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 259,720 KB
最終ジャッジ日時 2024-04-28 12:36:24
合計ジャッジ時間 11,950 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
51,712 KB
testcase_01 AC 36 ms
51,584 KB
testcase_02 AC 34 ms
51,712 KB
testcase_03 AC 154 ms
152,052 KB
testcase_04 AC 154 ms
107,212 KB
testcase_05 AC 396 ms
256,408 KB
testcase_06 AC 36 ms
51,968 KB
testcase_07 AC 543 ms
259,720 KB
testcase_08 AC 206 ms
166,848 KB
testcase_09 AC 526 ms
258,592 KB
testcase_10 AC 107 ms
102,728 KB
testcase_11 AC 131 ms
104,960 KB
testcase_12 AC 331 ms
256,720 KB
testcase_13 AC 102 ms
98,292 KB
testcase_14 AC 258 ms
157,260 KB
testcase_15 AC 335 ms
195,484 KB
testcase_16 AC 300 ms
173,324 KB
testcase_17 AC 282 ms
166,292 KB
testcase_18 AC 328 ms
193,188 KB
testcase_19 AC 167 ms
108,900 KB
testcase_20 AC 142 ms
99,712 KB
testcase_21 AC 158 ms
102,400 KB
testcase_22 AC 152 ms
106,880 KB
testcase_23 AC 168 ms
106,112 KB
testcase_24 AC 39 ms
52,224 KB
testcase_25 AC 38 ms
52,608 KB
testcase_26 AC 36 ms
52,736 KB
testcase_27 AC 43 ms
59,392 KB
testcase_28 AC 49 ms
61,952 KB
testcase_29 AC 187 ms
148,224 KB
testcase_30 AC 254 ms
157,256 KB
testcase_31 AC 259 ms
160,020 KB
testcase_32 AC 255 ms
159,300 KB
testcase_33 AC 285 ms
172,024 KB
testcase_34 AC 319 ms
192,672 KB
testcase_35 AC 346 ms
202,948 KB
testcase_36 AC 397 ms
195,096 KB
testcase_37 AC 441 ms
207,752 KB
testcase_38 AC 347 ms
207,540 KB
testcase_39 AC 364 ms
217,424 KB
testcase_40 AC 342 ms
207,128 KB
testcase_41 AC 316 ms
189,504 KB
testcase_42 AC 315 ms
192,324 KB
testcase_43 AC 365 ms
193,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def J():
	return map(int,input().split())
L,N=J()
X=list(J())+[L]
E=set()
F={0}
O={X[0]}
for i in range(1,N+1):
	G=set()
	for x in O:E.add(x),G.add(x-X[i])
	for x in F:O.add(x+X[i])
	F|=G
print(min(abs(x*2-L)for x in E))
0