TopCoder

Thumb img 0133
WTF!
我好廢啦晡賴補

User's AC Ratio

100.0% (19/19)

Submission's AC Ratio

55.6% (55/99)

Tags

Description

給定$N$個數$a_1,a_2,\ldots,a_N$以及$x$,求出有幾組$(i,j)$($1\le i< j\le N$),滿足$a_i\text{ xor }a_j=x$。

Input Format

第一行$N,x$。
第二行$N$個數$a_1,a_2,\ldots,a_N$。

Output Format

輸出有幾組$(i,j)$

Sample Input

6 1
5 1 2 3 4 1

Sample Output

2

Hints

$N\le 10^ 5$
$0\le x\le 10^ 5$
$\forall 1\le i\le N,0\le a_i\le 10^ 5$

Problem Source

Subtasks

For Testdata: 0 ~ 0, Score: 20
For Testdata: 1 ~ 1, Score: 20
For Testdata: 2 ~ 2, Score: 20
For Testdata: 3 ~ 3, Score: 20
For Testdata: 4 ~ 4, Score: 20
No. Time Limit (ms) Memory Limit (KiB) Output Limit (KiB)
0 1000 65536 65536
1 1000 65536 65536
2 1000 65536 65536
3 1000 65536 65536
4 1000 65536 65536