Mysterious Tree
CodeChefOpen on judge ↗
Mudit, Aakash, and Vaibhav are good friends. Once, they went for a jungle adventure. There, the trio came to know about a mysterious Apple tree. The trio thought of eating apples from the tree. The tree was rooted at node $1$ and consisted of total $N$ nodes including node $1$. Every node has an apple and a value associated with the node. The nodes are connected by edges having some weight $w$. Th
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