{"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":"Description","value":{"format":"MD","content":"普通的大富翁游戏太无聊了,公孙晚霁决定对其进行改编!\n\n首先,公孙晚霁对地图上所有地块(共 $n$ 个)按照顺序进行了编号。完成后,我们可以使用编号 $i(1\\leq i \\leq n)$ 找到地图的第 $i$ 个地块。每个地块的初始价格 $a_i$ 是已知的。\n接下来,公孙晚霁在原有游戏体系的基础上,添加了一种混乱卡。混乱卡上写有 $3$ 个数字,$l,\\text{ } r,\\text{ } x$,使用该卡片后,编号在 $[l, \\text{ } r]$范围内的所有地块的价格都会变成异或 $x$ 之后的结果,即执行 $a_l\u003da_l\\oplus x,a_{l+1}\u003da_{l+1}\\oplus x,…,a_r\u003da_r\\oplus x$。这个操作会改变 $r-l+1$ 个地块的价格。\n\n公孙晚霁邀请公孙英朗完成了一次新版大富翁的试玩。在试玩过程中按照时间顺序记录了以下两种信息:\n* $1\\text{ } l\\text{ } r$,表示 GSWJ 当前对编号在 $[l,\\text{ } r]$ 范围内的地块感兴趣。\n* $2\\text{ } l\\text{ } r\\text{ } x$,表示使用了一张写有$l\\text{ } r\\text{ } x\\text{ } 3$个数字的混乱卡,编号在 $[l, \\text{ } r]$范围内的所有地块的价格都会变成异或 $x$ 之后的结果。\n\n游戏结束后的复盘环节,公孙晚霁希望知道每个第一种信息中,她感兴趣的地块的价格之和。请你帮她解决这个问题。"}},{"title":"Input","value":{"format":"MD","content":"第一行包含一个整数 $n (1\\leq n\\leq 10^5)$表示地块的数量。\n\n第二行包含 $n$ 个整数 $a_1,a_2,\\cdots,a_n$ $(1\\leq a_i \\leq 10^6)$,$a_i$ 表示第 $i$ 个地块的初始价格。\n\n第三行包含一个整数 $m (1\\leq n\\leq 5\\times 10^4)$ 表示记录的数量。\n\n接下来$m$行,每行表示一条记录信息。每行首先包含首先包含一个整数 $t$ 表示记录的种类:\n* 如果 $t\u003d1$,表示这是第一种记录,接下来是 $2$ 个整数 $l,r$ $(1\\leq l \\leq r \\leq n)$,表示公孙晚霁当前感兴趣的区域为 $[l.. r]$;\n* 如果 $t\u003d2$,表示这是第二种记录,接下来是 $3$ 个整数 $l,r,x$ $(1\\leq l \\leq r \\leq n, 1\\leq x \\leq 10^6)$,表示使用了一张写有$l\\text{ } r\\text{ } x\\text{ } 3$个数字的混乱卡。"}},{"title":"Output","value":{"format":"MD","content":"对于每个类型为 $1$ 的记录,在单独的一行中打印出公孙晚霁感兴趣的地块的价格之和。按照输入中查询的顺序打印出查询的答案。\n请不要在C++中使用 $%lld$ 来读取或写入64位整数。最好使用 $cin$、$cout$ 流,或 $\\%I64d$ 格式说明符。"}},{"title":"Sample 1","value":{"format":"MD","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\n4 10 3 13 7\n8\n1 2 4\n2 1 3 3\n1 2 4\n1 3 3\n2 2 5 5\n1 1 5\n2 1 2 10\n1 2 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e26\n22\n0\n34\n11\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"Sample 2","value":{"format":"MD","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\u003e6\n4 7 4 0 7 3\n5\n2 2 3 8\n1 1 5\n2 3 5 1\n2 4 5 6\n1 2 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e38\n28\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}