E. Reachability from the Capital

Revision en1, by Doritos4, 2018-08-20 21:21:04

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, so I do that. Now, if unvisited vertices remain, they must form a cycle. So, I visit these vertices.

Please help

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)