Xor Sum 2 / AtCoder - 4142

Posted little-turtle--qjy

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Xor Sum 2 / AtCoder - 4142相关的知识,希望对你有一定的参考价值。

技术图片

Input

Input is given from Standard Input in the following format:
N
A1 A2 … An

Output

Print the number of the pairs of integers  l and r(1 <= l <= r <= N)that satisfy the condition.

Sample Input 1

 4
 2 5 4 6

Sample Output 1

 5

Sample Input 2

 9
 0 0 0 0 0 0 0 0 0

Sample Output 2

 45

Sample Input 3

 19
 885 8 1 128 83 32 256 206 639 16 4 128 689 32 8 64 885 969 1

Sample Output 3

 37

题意

n个数,有多少个区间的XOR等于区间的和

题解

枚举左端点,滑动右端点(双指针),找答案

代码

以上是关于Xor Sum 2 / AtCoder - 4142的主要内容,如果未能解决你的问题,请参考以下文章

Xor Sum 2 AtCoder - 4142 (异或前缀和性质+ 双指针)

找规律ARC 066D Xor Sum AtCoder - 2272

找规律ARC 066D Xor Sum AtCoder - 2272

[AtCoder2272] Xor Sum

[AtCoder2272] Xor Sum

AtCoder ABC 129E Sum Equals Xor