Problem adjlist
User squishychicken
Submission Time 2025-07-07 09:44:24
Score 0
Max Time N/A
Max Memory N/A

Compile Error

adjlist.cpp: In function ‘int main()’:
adjlist.cpp:11:18: error: ‘B’ was not declared in this scope
11 | g[a].push_back(B);
| ^
adjlist.cpp:12:18: error: ‘A’ was not declared in this scope
12 | g[b].push_back(A);
| ^
adjlist.cpp:14:14: error: cannot convert ‘std::vector<long long int>’ to ‘long long int’ in initialization
14 | for(int i : g){
| ^
adjlist.cpp:15:7: error: no match for ‘operator<<’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘std::vector<long long int>’)
15 | cout<<g[i];
| ~~~~^~~~~~
| | |
| | std::vector<long long int>
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/c++/9/istream:39,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,