One more problem with XOR
Easy
Execution time limit is 1 second
Runtime memory usage limit is 122.174 megabytes
Given array A with n nonegative integers, find the amount of pairs of numbers 1 ≤ l ≤ r ≤ n such that X ≤ A[l]
xor A[l + 1]
xor ... xor A[r]
for some given integer X. xor is operation of bit addition (in binary) by modulo two. The result of this operation is one if the bits of operands are different. For example: 10[10]
xor 23[10]
= 29[10]
, 1010[2]
xor 10111[2]
= 11101[2]
, here given an equation in binary and then in decimal notation.
Input
First line contains two integers n (1 ≤ n ≤ 10^5
) and X (0 ≤ X ≤ 10^9
). Next line contains n integers. Each number is no more than 10^9
.
Output
Print one number - the answer to the problem.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 67
Acceptance rate 22%