Directed graph is given with adjacency list. Find the number of edges in it. Input The first line contains the number of
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Directed graph is given with adjacency list. Find the number of edges in it. Input The first line contains the number of
Directed graph is given with adjacency list. Find the number of edges in it. Input The first line contains the number of vertices n. Then n lines are given. The i-th line contains the description of all edges, outgoing from the i-th vertex. Description starts with the number of outgoing edges. Then given the vertex numbers where the edges go. All vertices are numbered from 1 to n. Output Print the number of edges in the graph. Sample graph 3 2 Sample input 3 3 223 0 1 2 Sample output 1 2 3 (2,3) () (2) 0 0 0 1 1 0 0 1 0 Activate Windows Go to Settings to activate Windows.