Given a directed graph G , N vertices and M arcs.
A node X called "acessible" to Y if there is a path from X to Y
A node X called "popular" if every node Y in V fulfill one of two conditions :
1. X is acessible to Y
2. Y is acessible to X
The Problem : Given graph G, count the number of popular node.
- The first line contain N and M, the number of nodes and arcs (1 <= N <= 150000; 1 <= M <= 300000)
- M next lines, each line contains x and y, there is a arcs connect from x to y.
- First line print number of popular nodes.
- Second line print populars node in increasing order.
2 4 5