999E wrong ans on test case 31

Правка en4, от 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:(

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский Doritos4 2018-08-21 15:31:40 34 Tiny change: 'lease help' -> 'lease help\n\nEdit : I'm getting wa32 now:('
en3 Английский Doritos4 2018-08-21 08:43:59 42
en2 Английский Doritos4 2018-08-20 21:22:40 75
en1 Английский Doritos4 2018-08-20 21:21:04 511 Initial revision (published)