Problem graphcraft
User Alloy
Submission Time 2023-10-07 20:33:03
Score 0
Max Time N/A
Max Memory N/A

Compile Error

graphcraft.cpp: In function ‘void dfs(int)’:
graphcraft.cpp:20:5: error: expected primary-expression before ‘for’
20 | for (auto& i: adjList[cur]) {
| ^~~
graphcraft.cpp:25:16: error: ‘val’ was not declared in this scope
25 | res += val;
| ^~~
graphcraft.cpp: In function ‘int graphcraft(int, int, std::vector<std::pair<int, int> >*)’:
graphcraft.cpp:33:25: error: cannot convert ‘__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type’ {aka ‘std::pair<int, int>’} to ‘int’ in initialization
33 | int len = V[i][0];
| ^
graphcraft.cpp:34:74: error: ‘idx’ was not declared in this scope; did you mean ‘index’?
34 | for (int j = 1; j < len * 2 + 1; j+=2) adjList[i + 1].push_back({idx, V[i + 1]});
|