Problem adjlist
User blob
Submission Time 2023-11-17 11:13:33
Score 0
Max Time N/A
Max Memory N/A

Compile Error

adjlist.cpp: In function ‘int main()’:
adjlist.cpp:5:2: error: expected initializer before ‘cin’
5 | cin >> n >> e >> w;
| ^~~
adjlist.cpp:8:10: error: ‘w’ was not declared in this scope
8 | int adj[w];
| ^
adjlist.cpp:10:25: error: conflicting declaration ‘std::vector<std::pair<int, int> > adj [n]’
10 | vector <pair<int,int>> adj[n];
| ^~~
adjlist.cpp:7:6: note: previous declaration as ‘int adj [(n + 1)][(n + 1)]’
7 | int adj[n+1][n+1];
| ^~~
adjlist.cpp:14:12: error: request for member ‘push_back’ in ‘adj[n]’, which is of non-class type ‘int [(n + 1)]’
14 | adj[n].push_back(make_pair(i,j));
| ^~~~~~~~~
adjlist.cpp:19:11: error: request for member ‘push_back’ in ‘adj[n]’, which is of non-class type ‘int [(n + 1)]’
19 | adj[n].push_back(make_pair(k,l));
| ^~~~~~~~~<