2143C - Max Tree It is useful, and actually very easy to implement.
I tried to solve it with DFS, but not very obviously,that's not gonna work.
Spoiler
Topological Sort
2143C - Max Tree It is useful, and actually very easy to implement.
I tried to solve it with DFS, but not very obviously,that's not gonna work.