#P4932. Edge Counting with XOR Parity

    ID: 18173 Type: Default 1000ms 256MiB

Edge Counting with XOR Parity

Edge Counting with XOR Parity

Given n points where each point i has an associated weight \(x[i]\). For every pair of distinct points \(u\) and \(v\), if the bitwise XOR of their weights, \(x[u] \oplus x[v]\), has an odd number of \(1\)'s in its binary representation, then there is an edge between them. Your task is to compute the total number of edges.

If you fail to complete the task successfully, __stdcall will make you suffer by scoring you zero on this test case.

inputFormat

The input consists of two lines. The first line contains a single integer \(n\) \((1 \leq n \leq 10^5)\), the number of points. The second line contains \(n\) space-separated non-negative integers \(x[1], x[2], \ldots, x[n]\) \((0 \leq x[i] \leq 10^9)\) representing the weights of the points.

outputFormat

Output a single integer representing the total number of edges.

sample

4
1 2 3 4
4

</p>