← All problemsSign in

Glass Stepping Stones

Seong Gi-Hun is playing the game of Glass Stepping Stones with a bit of twist. A tree is given to him where initially each node is a normal glass. The tree is rooted at node $1$. $N-1$ edges of the tree are also given to him. The $i^{th}$ edge connect nodes $A_{i}$ and $B_{i}$, where $A_{i} \neq B_{i}$. To pass this game he needs to answer $Q$ queries. The $i^{th}$ query gives him a node, and aft

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