Advertisement
tinyevil

Untitled

Mar 29th, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. 1. Convert to the DAG by merging together nodes in the same strongly connected component in a supernode.
  2. 2. If there are two or more leaf supernodes, output any one node from two different leaf supernodes.
  3. 3. Otherwise, if there is a node with in-degree > 1, output any one node from its two different children.
  4. 4. Otherwise, there is no such pair.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement