CF-2095E•Codeforces
Pair Count
*specialnumber theory
You are given a prime number , integers , and an integer .
Find the number of pairs of indexes () for which .
Here denotes the bitwise XOR operation.
Input
The first line contains integers (, , ). is guaranteed to be prime.
The second line contains integers (). It is guaranteed that all elements are different.
Output
Output a single integer — answer to the problem.
Note
In the first example:
.
.
.
So only pair satisfies the condition.
In the second example, there are such pairs: , , .
Sample 1
Input
3 3 2 0 1 2
Output
1
Sample 2
Input
6 11 2 1 3 5 6 7 8
Output
3
Discussions & Comments
Share your approach or ask questions about this problem (0)
You must be logged in to comment or start a discussion on this problem.
Log InNo comments yet. Be the first to comment!
Actions
Open on CodeforcesAbout Platform
CO
Codeforces
External Judge
Problem Discussions
0Have questions or want to share your solution approach? Join the discussion.
View / write comments