Wealth Disparity in Family
CodeChefOpen on judge ↗
Problem description. A family has N members include children, parents, grandparents etc. numbered 1 ... N irrespective of their age. The family treat all members as equal without any consideration of any factor. Every member other than Mr. Pola (the head of the family) has a coordinator(P[i] denotes the coordinator of member i). Thus a member may manage any number of other members but he reports
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