← All problemsSign in

PROMISES WE MAKE

The Festive season is coming soon and Lisa is worried that her treehouse is not ready for the guests. The house has n rooms and n-1 bidirectional paths. From any room in the treehouse, there is a path to every other room. For each path Lisa knows whether the path is clean or not. She has n children in her house numbered from 1 to n. If the i-th child is selected he promises to clean all the

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