Problem dijkstra
User asbx
Submission Time 2023-11-15 09:34:06
Score 0
Max Time N/A
Max Memory N/A

Compile Error

dijkstra.cpp:1:1: error: ‘vector’ does not name a type
1 | vector<pair<int,int> > adjList[10000]; // weight, node
| ^~~~~~
dijkstra.cpp:2:1: error: ‘priority_queue’ does not name a type
2 | priority_queue<pair<int,int>, vector<pair<int,int> >, greater<pair<int,int> > > pq; // distance, node
| ^~~~~~~~~~~~~~
dijkstra.cpp:4:7: error: expected constructor, destructor, or type conversion before ‘(’ token
4 | memset(dist, -1, sizeof(dist)); // either set them to -1 or all to infinity, both work
| ^
dijkstra.cpp:5:1: error: ‘pq’ does not name a type
5 | pq.push(make_pair(0, source)); dist[source] = 0;
| ^~
dijkstra.cpp:5:32: error: ‘dist’ does not name a type
5 | pq.push(make_pair(0, source)); dist[source] = 0;
| ^~~~
dijkstra.cpp:6:1: error: expected unqualified-id before ‘while’
6 | while(!pq.empty()){