Editorial for Mock CCC '22 2 S2 - Kaguya Wants to Grow the Student Council


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Construct a DAG where person A has an outgoing edge to person B if every person prefers A to B. The answer is the length of the longest path on this DAG.


Comments


  • 0
    elitepala  commented on Jan. 25, 2022, 5:18 p.m.

    Can Someone elaborate a bit more. I got the idea about using DAG but how do we do updates or find the best.