#P7431. [THUPC 2017] 小 L 的计算题
[THUPC 2017] 小 L 的计算题
Problem Description
You are given a non-negative integer array of length . Little L defines a magical transform:
Little L plans to do something interesting with the sequence generated by this transform, but he is not good at multiplication, so he asks you for help and hopes you can compute as quickly as possible.
Input Format
The input contains multiple test cases.
The first line contains an integer , which indicates the number of test cases.
The next lines describe the test cases, with every two lines forming one test case.
In each test case, the first line contains an integer , which is the length of the array . The next line contains integers describing the array .
It is guaranteed that the input satisfy . In one test file, it is guaranteed that .
Output Format
We do not want you to output too many numbers. Therefore, let , where denotes the XOR operation, which can be written as ^ in C++ / Java / Python.
For each test case, output one integer per line, representing .
2
3
2 3 3
5
1 2 3 4 5
32
4675
Hint
For of the testdata, , , and .
Copyright Information
From THUPC (THU Programming Contest, Tsinghua University Programming Contest) 2017.
Translated by ChatGPT 5