From ad4f6ccb2e1c1c12e5d1637b48cb2ec355c022f6 Mon Sep 17 00:00:00 2001 From: Dev-XYS Date: Thu, 23 Feb 2017 11:47:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=AD=A3heap=5Ffloat=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dijkstra(Heap-Optimised).cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dijkstra(Heap-Optimised).cpp b/Dijkstra(Heap-Optimised).cpp index d236c99..65efbbc 100644 --- a/Dijkstra(Heap-Optimised).cpp +++ b/Dijkstra(Heap-Optimised).cpp @@ -86,7 +86,7 @@ void heap_sink(int i) void heap_float(int i) { int p = i >> 1; - while (p > 1 && V[H[i]].dis < V[H[p]].dis) + while (p >= 1 && V[H[i]].dis < V[H[p]].dis) { pos[H[i]] = p; pos[H[p]] = i;