← All problemsSign in

BITS and Bitcoins

The BITS Pilani campus takes the form of a rooted tree where each building acts as a vertex and the roads as the edges. There are a total of $N$ buildings indexed from 0 to $N$-$1$, Gautam is very fond of bitcoins and every building has some non-zero no of bitcoins hidden in a digital safe. He starts from the building with index 0 and travels to adjacent buildings to collect bitcoins , his goal 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