Tree Retrieval
There is a hidden tree with $N$ vertices labeled $1, 2, \ldots, N$. Your task is to recover the edges of the tree. You can ask queries, where you give a set $S$ of size **at least** $2$ to the judge. - Call a vertex $x \in S$ isolable, if there exists an edge in the tree such that if we remove this edge, no other vertex $y \in S$ is reachable from $x$. - The judge returns two integers, the fir
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start