Link to Guide’s Solution: https://usaco.guide/silver/dfs?lang=cpp
- The code does
vector<int> adj_list[MN];. Then when populating the adjacent matrix they do:
adj_list[u].push_back(v). I’m a little confused, adj_list is just a 1D vector right? in here they are accessing an element as if that element is a vector. When they create the vector shouldn’t it be a
vector <vector <int> > adj_list?