From 897e1ce25a75c803bbadff3b3c6108f209946b0f Mon Sep 17 00:00:00 2001 From: lthero <70460095+lthero-big@users.noreply.github.com> Date: 2025年8月26日 23:59:04 +0800 Subject: [PATCH] =?UTF-8?q?Update=200095.=E5=9F=8E=E5=B8=82=E9=97=B4?= =?UTF-8?q?=E8=B4=A7=E7=89=A9=E8=BF=90=E8=BE=93II.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正卡码网0095.城市间货物运输II中,Python解决SPFA方法求解含有负回路的最短路问题的错误 count[next_node] += 1应该在 if next_node not in d: 语句块内 --- ...27264円350円264円247円347円211円251円350円277円220円350円276円223円II.md" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/problems/kamacoder/0095.345円237円216円345円270円202円351円227円264円350円264円247円347円211円251円350円277円220円350円276円223円II.md" "b/problems/kamacoder/0095.345円237円216円345円270円202円351円227円264円350円264円247円347円211円251円350円277円220円350円276円223円II.md" index f9cf8151b0..736fd6dcee 100644 --- "a/problems/kamacoder/0095.345円237円216円345円270円202円351円227円264円350円264円247円347円211円251円350円277円220円350円276円223円II.md" +++ "b/problems/kamacoder/0095.345円237円216円345円270円202円351円227円264円350円264円247円347円211円251円350円277円220円350円276円223円II.md" @@ -509,8 +509,8 @@ def main(): for next_node, val in graph[cur_node]: if min_dist[next_node]> min_dist[cur_node] + val: min_dist[next_node] = min_dist[cur_node] + val - count[next_node] += 1 if next_node not in d: + count[next_node] += 1 d.append(next_node) if count[next_node] == n: # 如果某个点松弛了n次,说明有负回路 flag = True