999E wrong ans on test case 31

Revision en4, by Doritos4, 2018-08-21 15:31:40

I'm getting wa31 for this problem ( my submission ).

First, I find all vertices that can be reached from the capital. Then, I look at all vertices which have indegree equal to 0. These vertices must have an edge directly connecting them to the capital and can obviously be visited in any order. Now, if unvisited vertices remain, they must form a cycle. I visit these vertices next ( again, in any order).

Please help

Edit : I'm getting wa32 now:(

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English Doritos4 2018-08-21 15:31:40 34 Tiny change: 'lease help' -> 'lease help\n\nEdit : I'm getting wa32 now:('
en3 English Doritos4 2018-08-21 08:43:59 42
en2 English Doritos4 2018-08-20 21:22:40 75
en1 English Doritos4 2018-08-20 21:21:04 511 Initial revision (published)