Skip to content

Commit ef36f40

Browse files
committed
添加0126.骑士的攻击astar C语言 版本
1 parent 28de17e commit ef36f40

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

problems/kamacoder/0126.骑士的攻击astar.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ int astar(int start_x, int start_y, int goal_x, int goal_y) {
500500
Knight start;
501501
start.x = start_x;
502502
start.y = start_y;
503-
start.g = 0; // 从起点到起点的消耗为 0
503+
start.g = 0;
504504
start.h = heuristic(start_x, start_y, goal_x, goal_y);
505505
start.f = start.g + start.h; // 总的估计消耗
506506

@@ -547,7 +547,7 @@ int main() {
547547
scanf("%d %d %d %d", &a1, &a2, &b1, &b2);
548548

549549
int result = astar(a1, a2, b1, b2); // 使用 A* 算法计算最短路径
550-
printf("%d\n", result); // 输出所需的最小移动次数
550+
printf("%d\n", result); // 输出最小移动次数
551551
}
552552
return 0;
553553
}

0 commit comments

Comments
 (0)