diff options
Diffstat (limited to 'graph')
| -rw-r--r-- | graph/dijkstra.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/graph/dijkstra.cpp b/graph/dijkstra.cpp index e7ec0c3..92df955 100644 --- a/graph/dijkstra.cpp +++ b/graph/dijkstra.cpp @@ -5,16 +5,16 @@ dist[0] = 0; pq.push(ii(0, 0)); while (!pq.empty()) { - di front = pq.top(); pq.pop(); + ii front = pq.top(); pq.pop(); int curNode = front.second, curDist = front.first; if (curDist > dist[curNode]) continue; - for (i = 0; i < (int)adjlist[curNode].size(); i++) { + for (int i = 0; i < (int)adjlist[curNode].size(); i++) { int nextNode = adjlist[curNode][i].first, nextDist = curDist + adjlist[curNode][i].second; if (nextDist < dist[nextNode]) { dist[nextNode] = nextDist; pq.push(ii(nextDist, nextNode)); } } -}
\ No newline at end of file +} |
