Problem dijkstra
User shoryu386
Submission Time 2023-05-21 21:00:52
Score 0
Max Time N/A
Max Memory N/A

Compile Error

dijkstra.cpp: In function ‘int main()’:
dijkstra.cpp:28:64: error: type/value mismatch at argument 3 in template parameter list for ‘template<class _Tp, class _Sequence, class _Compare> class std::priority_queue’
28 | priority_queue<pair<int , int>, vector<pair<int, int>>, cmp>pq;// node , weight
| ^
dijkstra.cpp:28:64: note: expected a type, got ‘cmp’
dijkstra.cpp:29:8: error: request for member ‘push’ in ‘pq’, which is of non-class type ‘int’
29 | pq.push(make_pair(0, 0));
| ^~~~
dijkstra.cpp:31:14: error: request for member ‘size’ in ‘pq’, which is of non-class type ‘int’
31 | while(pq.size() > 0) {
| ^~~~
dijkstra.cpp:32:27: error: request for member ‘top’ in ‘pq’, which is of non-class type ‘int’
32 | int currnode = pq.top().first , currdist = pq.top().second;
|