Transitive closure
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Find the transitive closure of the directed graph.
Input
The directed graph is given with the list of edges. The first line contains the number of vertices . Each of the next lines contains two vertices and describing the directed edge from to .
Output
Print the adjacency matrix of the transitive closure of the directed graph.
Examples
Input #1
Answer #1
Submissions 165
Acceptance rate 65%