Directed graph - timestamps
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
The directed graph is given in the form of an adjacency list. Run a depth-first search on the graph. Print the timestamps and for each vertex in ascending order of vertices.
Input
The first line contains the number of vertices . The next -th line contains the number of edges adjacent to the -th vertex and the vertex numbers.
Output
Run a depth-first search on the graph. Print the timestamps and for each vertex . Print the timestamps for each vertex on a separate line.
Examples
Input #1
Answer #1
Submissions 176
Acceptance rate 84%