Flip is
This commit is contained in:
2
15/15.py
2
15/15.py
@@ -28,7 +28,7 @@ def dijkstra(grid):
|
|||||||
for neighbour in neighbors(u, grid.shape):
|
for neighbour in neighbors(u, grid.shape):
|
||||||
new = dist[u] + grid[neighbour]
|
new = dist[u] + grid[neighbour]
|
||||||
|
|
||||||
if dist[neighbour] > new:
|
if new < dist[neighbour]:
|
||||||
dist[neighbour] = new
|
dist[neighbour] = new
|
||||||
heappush(q, (new, neighbour))
|
heappush(q, (new, neighbour))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user