atcoder#ARC127D. [ARC127D] Sum of Min of Xor
[ARC127D] Sum of Min of Xor
Score : points
Problem Statement
Given are sequences of integers each: and .
Find $\sum_{1 \leq i < j \leq N} \min(A_i \oplus A_j, B_i \oplus B_j)$, where denotes the bitwise XOR.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
3
1 2 3
4 5 6
4
Thus, the answer is .
4
1 2 3 4
1 2 3 4
24
10
195247 210567 149398 9678 23694 46151 187762 17915 176476 249828
68649 128425 249346 62366 194119 117620 26327 161384 207 57656
4019496