Sonic And Family Tree
CodeChefOpen on judge ↗
Sonic has found his family tree drawn by his great grandfather. He partitions the tree into different descendant paths. He wonders what could be the minimal size of a partition out of all partitions possible. Size of a partition is the number of different descendant paths in that partition. Each member of the family tree should belong to exactly one descendant path. As the drawing is quite old, so
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