Pinely Round 2 (Div. 1 + Div. 2) |
---|
Finished |
You are given an array of $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$.
In one operation you split the array into two parts: a non-empty prefix and a non-empty suffix. The value of each part is the bitwise XOR of all elements in it. Next, discard the part with the smaller value. If both parts have equal values, you can choose which one to discard. Replace the array with the remaining part.
The operations are being performed until the length of the array becomes $$$1$$$. For each $$$i$$$ ($$$1 \le i \le n$$$), determine whether it is possible to achieve the state when only the $$$i$$$-th element (with respect to the original numbering) remains.
Formally, you have two numbers $$$l$$$ and $$$r$$$, initially $$$l = 1$$$ and $$$r = n$$$. The current state of the array is $$$[a_l, a_{l+1}, \ldots, a_r]$$$.
As long as $$$l < r$$$, you apply the following operation:
For each $$$i$$$ ($$$1 \le i \le n$$$), determine whether it is possible to achieve $$$l = r = i$$$.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10\,000$$$). The description of the test cases follows.
The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 10\,000$$$).
The second line of each test case contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i < 2^{60}$$$).
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10\,000$$$.
For each test case, output a single string of length $$$n$$$ where the $$$i$$$-th element is equal to 1 if it is possible to achieve $$$l = r = i$$$ and is equal to 0 otherwise.
663 2 1 3 7 451 1 1 1 1101 2 4 8 4 1 2 3 4 550 0 0 0 051 2 3 0 11100500
111111 10101 0001000000 11111 11001 1
In the first test case, it is possible to achieve $$$l = r = i$$$ for any $$$i$$$ from $$$1$$$ to $$$n$$$:
Let's take a closer look at $$$i = 2$$$. Initially $$$l = 1$$$, $$$r = 6$$$.
Name |
---|