{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"题目解释","value":{"format":"MD","content":"今天在课上,Vitya 学习了一个非常有趣的函数 —— $$$mex$$$。$$$Mex$$$ 函数是一个序列中最小的非负数,该数不在序列中出现。例如,$$$mex([4, 33, 0, 1, 1, 5]) \u003d 2$$$ 和 $$$mex([1, 2, 3]) \u003d 0$$$。\n\nVitya 很快就理解了老师的所有任务,但你能做到吗?\n\n给你一个由 $$$n$$$ 个非负整数组成的数组,以及 $$$m$$$ 个查询。每个查询都由一个数字 $$$x$$$ 表示,并包括以下连续步骤:\n\n- 对数组中的每个元素和数字 $$$x$$$ 执行模 $$$2$$$ 的位加法操作($$$xor$$$)。\n- 找到结果数组的 $$$mex$$$。\n\n请注意,每次查询后数组都会改变。"}},{"title":"输入格式","value":{"format":"MD","content":"第一行包含两个整数 $$$n$$$ 和 $$$m$$$ ($$$1 \\le $$$n$$$, $$$m$$$ \\le 3·10^5$$$) — 数组中的元素数量和查询的数量。\n\n下一行包含 $$$n$$$ 个整数 $$$a_i$$$ ($$$0 \\le $$$a_i$$$ \\le 3·10^5$$$) — 数组的元素。\n\n接下来的 $$$m$$$ 行每行包含一个查询 — 一个整数 $$$x$$$ ($$$0 \\le x \\le 3·10^5$$$)。"}},{"title":"输出格式","value":{"format":"MD","content":"对于每个查询,将答案打印在单独的一行上。"}},{"title":"样例 #1","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003e输入\u003c/th\u003e\n \u003cth\u003e输出\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2 2\n1 3\n1\n3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n0\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"样例 #2","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003e输入\u003c/th\u003e\n \u003cth\u003e输出\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4 3\n0 1 5 6\n1\n2\n4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n0\n0\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"样例 #3","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003e输入\u003c/th\u003e\n \u003cth\u003e输出\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5 4\n0 1 5 6 7\n1\n1\n4\n5\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n2\n0\n2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}