Transitive closure#10157

Transitive closure

1 segundo
128 megabytes
Media

Find the transitive closure of the directed graph.

Entrada

The directed graph is given with the list of edges. The first line contains the number of vertices n~(1 \le n \le 100). Each of the next lines contains two vertices and b~(1 \le a, b \le n) describing the directed edge from to .

Salida

Print the adjacency matrix of the transitive closure of the directed graph.

Ejemplos

Ejemplo 1

Loading
Loading