{"trustable":false,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e\n有一个长度为 n 的整数序列 a,有两种操作:\n \u003cbr\u003e\n \u003cli\u003e0 l r: 0 l r:从 $a_l...a_r$ 中选择一些数字 使它们的异或和最大,并打印最大值。\u003c/li\u003e\n \u003cbr\u003e\n \u003cli\u003e1 x: 将 $x$ 附加到序列的末尾并让 $n\u003dn+1$。\u003c/li\u003e\n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"有多个测试用例。 输入的第一行包含一个整数$T(T\\le 10)$,表示测试用例的数量。\n\u003cbr\u003e对于每个测试用例:\n\u003cbr\u003e第一行包含两个整数$n, m(1\\le n\\le 5\\times 10^5, 1\\le m\\le 5\\times 10^5)$,序列中最初的整数个数 和操作次数。\n\u003cbr\u003e第二行包含$n$个整数$a_1,a_2,...,a_n(0\\le a_i\u003c2^{30})$,表示初始序列。\n\u003cbr\u003e接下来的每一行 $m$ 都包含上面给出的操作之一。\n\u003cbr\u003e保证 $\\sum n\\le 10^6, \\sum m\\le 10^6 , 0\\le x\u0026lt; 2^{30}$。\n\u003cbr\u003e并且操作将被加密。 您需要对操作进行如下解码,其中 lastans 表示最近一次类型 0 操作的答案,最初为零:\n\u003cbr\u003e对于每个类型 0 操作,令 l\u003d(l xor lastans)mod n + 1, r\u003d(r xor lastans)mod n + 1,然后如果 l\u003er 则交换(l, r)。\n\u003cbr\u003e对于每个类型 1 操作,让 x\u003dx xor lastans。"}},{"title":"Output","value":{"format":"HTML","content":"对于每个类型 0 操作,请在一行中输出最大异或和。"}},{"title":"Sample","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\u003e\u003cpre\u003e1\n3 3\n0 1 2\n0 1 1\n1 3\n0 3 4\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e\u003cpre\u003e1\n3\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}