RACE ON THE TREE
CodeChefOpen on judge ↗
**Chef** has **N** monkeys numbered 1, 2, 3 ... N, in his house. One day, he constructs a full binary tree of height **H** and places **N** monkeys on its nodes for a race. The race will end when all the monkeys reach the **root** of the tree. **Chef** knows the speed of every monkey. If the speed of the monkey is **x**, then he can jump **j** edges such that $(j$$ $<=$ $$x)$ in 1 second. Winn
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