From ef36f40e4365cff7113c0f084d9cc3058de6e469 Mon Sep 17 00:00:00 2001 From: Kuxry Date: Wed, 30 Oct 2024 10:34:03 +0900 Subject: [PATCH] =?UTF-8?q?=20=E6=B7=BB=E5=8A=A00126.=E9=AA=91=E5=A3=AB?= =?UTF-8?q?=E7=9A=84=E6=94=BB=E5=87=BBastar=20C=E8=AF=AD=E8=A8=80=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/kamacoder/0126.骑士的攻击astar.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/problems/kamacoder/0126.骑士的攻击astar.md b/problems/kamacoder/0126.骑士的攻击astar.md index 403fe1fa..e3ce98f6 100644 --- a/problems/kamacoder/0126.骑士的攻击astar.md +++ b/problems/kamacoder/0126.骑士的攻击astar.md @@ -500,7 +500,7 @@ int astar(int start_x, int start_y, int goal_x, int goal_y) { Knight start; start.x = start_x; start.y = start_y; - start.g = 0; // 从起点到起点的消耗为 0 + start.g = 0; start.h = heuristic(start_x, start_y, goal_x, goal_y); start.f = start.g + start.h; // 总的估计消耗 @@ -547,7 +547,7 @@ int main() { scanf("%d %d %d %d", &a1, &a2, &b1, &b2); int result = astar(a1, a2, b1, b2); // 使用 A* 算法计算最短路径 - printf("%d\n", result); // 输出所需的最小移动次数 + printf("%d\n", result); // 输出最小移动次数 } return 0; }