Problem J. Query on A Tree
时间限制 10000 ms
内存限制 129.65625 MB
Monkey A lives on a tree, he always plays on this tree.
One day, monkey A learned about one of the bit-operations, xor. He was keen of this interesting operation and wanted to practise it at once.
Monkey A gave a value to each node on the tree. And he was curious about a problem.
The problem is how large the xor result of number x and one node value of label y can be, when giving you a non-negative integer x and a node label u indicates that node y is in the subtree whose root is u(y can be equal to u).
Can you help him?
输入数据
输出数据
For each query, just print an integer in a line indicating the largest result.
样例输入
样例输出
$ Mathjax font initiator $