A method to find the parent of each node in 2log queries is given.
Consider the following coloring: 001100110011..., i.e., grouping by $$$\bmod 4 \le 1$$$.
Then, according to the binary representation, we perform two queries each time: one taking nodes with color 0, and another taking nodes with color 1.
With the pattern 001100110011..., querying with color 0 yields the parents of nodes with $$$\bmod 4 = 1/2$$$, while querying with color 1 yields the parents of nodes with $$$\bmod 4 = 0/3$$$.
In this way we can find the parent of each node using 2log queries.
Analysis shows that at most 44 queries are needed, and at most 41 on the official test data.
Provided by Chery's ChatGPT 5.5 Pro.



