Idols and Fans
Mike is a cool kid, so he's the most popular person in his school. All the girls want to be with him while all the boys want to be like him. There are N persons in Mike's school. No person in the school has a name(except Mike), but all of them have a unique ID integer number for the range[1..N]. Mike's ID equals to 1. Also, each person(except Mike) has his/her personal idol, who is another person
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