← All problemsSign in

Interactive Tree

CodeChefRating 3063Open on judge ↗

**This is an interactive task** You are given a tree consisting of $N$ nodes, numbered from $1$ to $N$. The edges are numbered from $1$ to $N-1$. Chef selected an arbitrary node and marked it, but the marked node is unknown to you. Chef gave you an interactor to play with, using which you can ask queries about the given tree. In each query, you can print a subset (possibly **empty**) of edges.

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start