← All problemsSign in

The Ancient Tree

Nico Robin is taking a walk in the park, hoping to be lucky enough to come across a devil fruit, when she sees a tree. She observes that the tree is **special**. The tree has **n nodes**, rooted at node $1$. In this special tree, **each node i** has a character value **ch[i]** assigned to it where $a\leq ch[i]\leq z$ On coming closer to the tree, she is asked **Q** queries. In each query, she is

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