链接:
https://ac.nowcoder.com/acm/contest/57361/C
来源:牛客网
Students from Antarctic Penguin Language School are studying sequence.
We call a sequence A=(A1,A2,…,An)A=(A_1, A_2, \dots, A_n)A=(A1,A2,…,An) of length nnn beautiful when all the following conditions are true:
-
A1≤A2≤⋯≤AnA_1 \le A_2 \le \dots \le A_nA1≤A2≤⋯≤An
-
For each AiA_iAi (1≤i≤n1\le i\le n1≤i≤n), 0≤Ai<2300\le A_i<2^{30}0≤Ai<230.
-
For each 1≤i<n1\le i<n1≤i<n, Ai⊕Ai+1=BiA_i\oplus A_{i+1}=B_iAi⊕Ai+1=Bi, where BBB is a given sequence, and ⊕\oplus⊕ represents bitwise XOR.
You need to find the kkk-th smallest lexicographically legal beautiful sequence AAA.