Problem B in Round #758 (Div.1 + Div. 2) using Topological Sort ?

Revision en2, by GlydonNeedsDedication, 2021-12-12 16:11:50

I saw this Solution of Problem B by maroonrk using Topological sort in contest Round #758 (Div.1 + Div. 2)
Can anybody explains the intuition please?

Tags query, discussion

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English GlydonNeedsDedication 2021-12-12 16:11:50 9
en1 English GlydonNeedsDedication 2021-12-12 16:10:41 438 Initial revision (published)