{"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":"HTML","content":"\u003cp\u003e今天在课上,Vitya 学到了一个非常有趣的函数 $$$\\text{mex}$$$。$$$\\text{mex}$$$ 是一个整数序列的最小非负数,它不作为元素出现在序列中。例如,$$$\\text{mex} ([4,33,0,1,1,5])\u003d2$$$,且 $$$\\text{mex} ([1,2,3]) \u003d0$$$。\u003c/p\u003e\n\n\u003cp\u003eVitya 很快就理解了老师提出的所有任务,但你能做到吗?\u003c/p\u003e\n\n\u003cp\u003e给定一个由 $$$n$$$ 个非负整数组成的数组,以及 $$$m$$$ 个查询。每个查询由一个数 $$$x$$$ 描述,并包括以下连续步骤:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e 每个数组元素,与整数 $$$x$$$ 执行按位异或 ($$$\\text{xor}$$$) 的运算。 \u003c/li\u003e\n\u003cli\u003e 找到结果数组的 $$$\\text{mex}$$$ 值。 \u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003e\u003cstrong\u003e注意\u003c/strong\u003e: 每次查询后,数组都会发生变化。\u003c/p\u003e"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e第一行包含两个整数 $$$n,m$$$ $$$(1 \\leq n, m \\leq 3 \\cdot 10^5)$$$,表示数组中的元素个数,以及查询次数。\u003c/p\u003e\n\n\u003cp\u003e第二行包含 $$$n$$$ 个整数 $$$a_i$$$ $$$(0 \\leq a_i \\leq 3 \\cdot 10^5)$$$,表示数组的各元素。\u003c/p\u003e\n\n\u003cp\u003e接下来 $$$m$$$ 行,每行一个查询,包含整数 $$$x$$$ $$$(0 \\leq x \\leq 3 \\cdot 10^5)$$$。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e对于每个查询,在单独一行中打印答案。\u003c/p\u003e"}},{"title":"示例 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\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"}},{"title":"示例 2","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\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"}},{"title":"示例 3","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\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"}}]}