Problem dijkstra
User zsinfo2010
Submission Time 2023-11-15 09:28:05
Score 0
Max Time N/A
Max Memory N/A

Compile Error

dijkstra.cpp:9:7: error: expected constructor, destructor, or type conversion before ‘(’ token
9 | memset(dist, -1, sizeof(dist)); // either set them to -1 or all to infinity, both work
| ^
dijkstra.cpp:10:1: error: ‘pq’ does not name a type
10 | pq.push(make_pair(0, source)); dist[source] = 0;
| ^~
dijkstra.cpp:10:32: error: ‘dist’ does not name a type
10 | pq.push(make_pair(0, source)); dist[source] = 0;
| ^~~~
dijkstra.cpp:11:1: error: expected unqualified-id before ‘while’
11 | while(!pq.empty()){
| ^~~~~