← All problemsSign in

Special Tour

Mathematician Shubham has a beautiful tree with $ N$ vertexes numbered from $1 to N$. He makes a $Special Tour$ of the tree and stores the output in an array $A$ starting with index $0$. Seeing this array his friend Sid asks him $q$ queries. In each query Sid gives him two indexes $i,j$ . Shubham needs to tell him the vertex $v$ which lies between these two indexes i.e $A[k]=v$ where $i ###Const

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