I want to implement a presentation of a list of contiguous graphs from a book on competitive programming. 1. The implementation uses a vector of V vertices, and for each vertex v another. a vector that contains pairs (the neighboring vertex and its edge weight) that have a v relationship. I am having problems with inputting this graph and displaying the output.
In the book they made such statements:
#include <iostream> #include <vector> using namespace std; typedef pair<int, int> ii; typedef vector<ii> vii; vector <vii> AdjList;
How can I take the input of the next graph as an adjacency list and display it as an adjacency list? Suppose each cost of an edge is 10.

graph
aroup
source share