Problem dijkstra
User UNowen
Submission Time 2025-03-19 21:14:44
Score 0
Max Time N/A
Max Memory N/A

Compile Error

dijkstra.cpp: In function ‘int32_t main()’:
dijkstra.cpp:27:18: error: ‘x’ was not declared in this scope
27 | for(auto v:adj[x]){
| ^
dijkstra.cpp:30:24: error: no matching function for call to ‘std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, int> >, std::greater<std::pair<int, int> > >::push(<brace-enclosed initializer list>)’
30 | pq.push({dist[v],v});
| ^
In file included from /usr/include/c++/9/queue:64,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:86,
from dijkstra.cpp:1:
/usr/include/c++/9/bits/stl_queue.h:627:7: note: candidate: ‘void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = std::pair<int, int>; _Sequence = std::vector<std::pair<int, int> >; _Compare = std::greater<std::pair<int, int> >; std::priority_que