[Solution] XOR Mixup Codeforces Solution
There is an array with integers. Let be the bitwise XOR of all elements of the array. The number is added to the end of the array (now it has length ), and then the elements are shuffled.
You are given the newly formed array . What is ? If there are multiple possible values of , you can output any of them.
The input consists of multiple test cases. The first line contains an integer () — the number of test cases. The description of the test cases follows.
The first line of each test case contains an integer () — the number of integers in the resulting array .
The second line of each test case contains integers () — the elements of the newly formed array .
Additional constraint on the input: the array is made by the process described in the statement; that is, some value of exists.
For each test case, output a single integer — the value of , as described in the statement. If there are multiple possible values of , output any of them.
No comments:
Post a Comment