#B. 异或

    Type: Default 1000ms 256MiB

异或

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

[丛雨]有一个数列 a1,a2,...,ana_1, a_2, ..., a_n 。有一天,[芳乃]拿来了一个正整数 XX 。丛雨是一个特别喜欢异或(xor)运算的孩子,她也很喜欢芳乃。于是,丛雨就想知道,自己能找到多少对数 (i,j)(i,j) 能够满足 ai xor aj=Xa_i\ xor\ a_j = X 。 两个数对 (i1,j1)(i_1, j_1)(i2,j2)(i_2, j_2) 不同,当且仅当 i1i2i_1 ≠ i_2 或者 j1j2j_1 ≠ j_2

提示:异或运算在C++里的算符是 ^

输入格式(xor.in)

第一行两个正整数 nn , XX ,分别表示数列的长度以及芳乃带来的整数。 第二行包含 nn 个正整数,表示数列 ana_n

输出格式(xor.out)

一行一个整数表示答案。

输入样例

5 1
1 4 2 2 5

输出样例

2

样例解释

因为 4 xor 5=14\ xor\ 5 = 1 ,所以这两个数对是 (2,5)(2,5)(5,2)(5,2)

数据范围

对于 50%50\% 的数据, 1n20001 \le n \le 2000 。 对于接下来 20%20\% 的数据,1ai1000001 \le a_i \le 100000 。 对于 100%100\% 的数据,$1 \le n \le 1000000, 1 \le a_i \le 2^{30}, 1 \le X \le 2^{30}$ 。

0715测试

Not Attended
Status
Done
Rule
IOI
Problem
4
Start at
2024-7-15 14:00
End at
2024-7-15 17:30
Duration
3.5 hour(s)
Host
Partic.
30