AtCoder Beginner Contest 091
D
Two Sequences
AtCoder
⌀ 2207
原题
← C→
翻译中…

Problem Statement

翻译中…

You are given two integer sequences, each of length $N$: $a_1, ..., a_N$ and $b_1, ..., b_N$.

翻译中…

There are $N^2$ ways to choose two integers $i$ and $j$ such that $1 \leq i, j \leq N$. For each of these $N^2$ pairs, we will compute $a_i + b_j$ and write it on a sheet of paper. That is, we will write $N^2$ integers in total.

翻译中…

Compute the XOR of these $N^2$ integers.

翻译中…

Definition of XOR The XOR of integers $c_1, c_2, ..., c_m$ is defined as follows: Let the XOR be $X$. In the binary representation of $X$, the digit in the $2^k$'s place ($0 \leq k$; $k$ is an integer) is $1$ if there are an odd number of integers among $c_1, c_2, ...c_m$ whose binary representation has $1$ in the $2^k$'s place, and $0$ if that number is even. For example, let us compute the XOR of $3$ and $5$. The binary representation of $3$ is $011$, and the binary representation of $5$ is $101$, thus the XOR has the binary representation $110$, that is, the XOR is $6$.

翻译中…

Constraints

翻译中…
  • All input values are integers.
  • $1 \leq N \leq 200,000$
  • $0 \leq a_i, b_i < 2^{28}$
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N
a_1 a_2 ... a_N
b_1 b_2 ... b_N

翻译中…

Output

翻译中…

Print the result of the computation.

翻译中…

样例

Input #1
2
1 2
3 4
Output #1
2
On the sheet, the following four integers will be written: $4(1+3), 5(1+4), 5(2+3)$ and $6(2+4)$.
Input #2
6
4 6 0 0 3 3
0 5 6 5 0 3
Output #2
8
Input #3
5
1 2 3 4 5
1 2 3 4 5
Output #3
2
Input #4
1
0
0
Output #4
0
题目信息
题号
arc092_b
时间限制
3 s
内存限制
256 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。