Salad
CodeChefOpen on judge ↗
You are given a tree initially having only one node(root node) with id **x** and associated value **value**. You are also given **Q** queries having following types: - **Type 0:** Append node with id **v** and associated value **val** to node with id **u**. In other words, **u** will be parent of **v**. - **Type 1:** Find the value **val** out of all associated values to nodes on path from root (
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