#P10307. 「Cfz Round 2」Binary
「Cfz Round 2」Binary
Problem Description
You are given integers .
For an integer , suppose the bit positions where its binary representation is are . Then its weight is $f(u) = a_{k_1} \oplus a_{k_2} \oplus \dots \oplus a_{k_m}$. Here, the binary bit positions are numbered from right to left as . The symbol denotes the bitwise XOR.
You want to know how many integers satisfy . For convenience, please output the answer in binary form (no modulo).
Note: The output must not contain leading , unless the answer is .
Input Format
This problem contains multiple test cases.
The first line contains an integer , the number of test cases.
Then the test cases follow. For each test case:
- The first line contains a positive integer .
- The second line contains integers .
Output Format
For each test case, output one line containing a binary integer, which is the answer.
Reminder: The output must not contain leading , unless the answer is .
5
2
0 1 2
3
1 3 3 1
4
2 2 5 4 2
5
7 0 3 4 0 1
6
5 2 1 8 6 0 9
10
1
100
11
0
Hint
"Sample Explanation #1"
For the first test case:
- , so .
- , so .
- , so .
- , so .
- , so .
Among them, we have and , so the output is .
"Constraints"
Let be the sum of within a single test file.
For all testdata, , , , .
Only if you pass all test points of this problem can you get the score for this problem.
Translated by ChatGPT 5