| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 137 | 50 | 22 | 24.719% |
Fran recently learned the operation xor, which for two integers $x$ and $y$ returns the result by applying the bitwise exclusive or (exclusive or). The operation xor, denoted as $\oplus,ドル compares the corresponding bits of the numbers $x$ and $y$ and sets the result bit at each position according to the following rule:
For example, for $x = 5$ and $y = 3,ドル the binary representations are: $x = 101_2,ドル $y = 011_2$. Applying xor to the corresponding bits gives $x \oplus y = 101_2 \oplus 011_2 = 110_2 = 6$. In other words, 5ドル \oplus 3 = 6$.
Fran received an array of $n$ integers $a_1, a_2, \dots , a_n$ and decided to do the following:
Help Fran calculate the required result.
In the first line of input, there is $n$ (1ドル ≤ n ≤ 5 \cdot 10^5$), the length of the array.
In the second line, there are $n$ numbers $a_1, a_2, \dots , a_n$ (0ドル ≤ a_i < 2^{30}$) as described in the problem statement.
In the only line of output, print the required result.
| 번호 | 배점 | 제한 |
|---|---|---|
| 1 | 7 | $n ≤ 2000$ |
| 2 | 17 | $a_i < 2^{10}$ for every $i$ |
| 3 | 45 | $n ≤ 10^5$ |
| 4 | 21 | No additional constraints. |
3 2 4 5
14
4 6 7 3 1
3
7 2 3 5 7 9 11 13
6
Clarification of the first example:
The sums are 2ドル + 2 = 4,ドル 2ドル + 4 = 6,ドル 2ドル + 5 = 7,ドル 4ドル + 4 = 8,ドル 4ドル + 5 = 9,ドル and 5ドル + 5 = 10$. The result is 4ドル \oplus 6 \oplus 7 \oplus 8 \oplus 9 \oplus 10 = 14$.