From adjacency list to adjacency matrix#3982

From adjacency list to adjacency matrix

1 second
128 megabytes
Very easy

A simple directed graph is given as an adjacency list. Output its representation as an adjacency matrix.

\InputFileThe first line contains the number of vertices (1 \leq n \leq 100). Each of the following lines describes the outgoing edges from the -th vertex. Each line begins with the number of outgoing edges, followed by the numbers of the vertices those edges point to. Vertices are numbered from to .

\OutputFileOutput the adjacency matrix of the directed graph.

prb3982.gif

Examples

Example 1

Loading
Loading