{"trustable":true,"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eVasya有一个由$$$a$$$组成的序列,包含$$$n$$$个整数$$$a_1, a_2, \\dots, a_n$$$。Vasya可以进行以下操作:选择序列中的某个数字,并交换其二进制表示中的任意一对位。例如,Vasya可以将数字$$$6$$$ $$$(\\dots 00000000110_2)$$$转换为$$$3$$$ $$$(\\dots 00000000011_2)$$$、$$$12$$$ $$$(\\dots 000000001100_2)$$$、$$$1026$$$ $$$(\\dots 10000000010_2)$$$等。Vasya可以在序列中的任意数字上任意次数(可能为零次)使用此操作。\u003c/p\u003e\u003cp\u003eVasya将一个序列称为\u003cspan class\u003d\"tex-font-style-it\"\u003e好\u003c/span\u003e的,如果通过上述操作,他可以得到所有元素的\u003ca href\u003d\"https://en.wikipedia.org/wiki/Exclusive_or\"\u003e按位异或\u003c/a\u003e等于$$$0$$$的序列。\u003c/p\u003e\u003cp\u003e对于给定序列$$$a_1, a_2, \\ldots, a_n$$$,Vasya想要计算整数对的数量$$$(l, r)$$$,使得$$$1 \\le l \\le r \\le n$$$且序列$$$a_l, a_{l + 1}, \\dots, a_r$$$是好的。\u003c/p\u003e"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e第一行包含一个整数$$$n$$$($$$1 \\le n \\le 3 \\cdot 10^5$$$)— 序列的长度。\u003c/p\u003e\u003cp\u003e第二行包含$$$n$$$个整数$$$a_1, a_2, \\dots, a_n$$$($$$1 \\le a_i \\le 10^{18}$$$)— 序列$$$a$$$。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e输出一个整数 — 满足$$$1 \\le l \\le r \\le n$$$且序列$$$a_l, a_{l + 1}, \\dots, a_r$$$是好的整数对的数量$$$(l, r)$$$。\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\u003e3\n6 7 14\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\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\n1 2 1 16\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"注意","value":{"format":"HTML","content":"\u003cp\u003e在第一个示例中,整数对$$$(2, 3)$$$和$$$(1, 3)$$$是有效的。整数对$$$(2, 3)$$$是有效的,因为$$$a_2 \u003d 7 \\rightarrow 11$$$,$$$a_3 \u003d 14 \\rightarrow 11$$$和$$$11 \\oplus 11 \u003d 0$$$,其中$$$\\oplus$$$为按位异或。整数对$$$(1, 3)$$$是有效的,因为$$$a_1 \u003d 6 \\rightarrow 3$$$,$$$a_2 \u003d 7 \\rightarrow 13$$$,$$$a_3 \u003d 14 \\rightarrow 14$$$和$$$3 \\oplus 13 \\oplus 14 \u003d 0$$$。\u003c/p\u003e\u003cp\u003e在第二个示例中,整数对$$$(1, 2)$$$,$$$(2, 3)$$$,$$$(3, 4)$$$和$$$(1, 4)$$$是有效的。\u003c/p\u003e"}}]}