Skip to content

Commit fe58e95

Browse files
committed
7562 수정
1 parent a2845fd commit fe58e95

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmkim/BaekJoon/백준_7562.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def bfs(x, y, count): # x -> row | y -> col
1616
ny = y + dy[i]
1717
if 0 <= nx < n and 0 <= ny < n and visited[nx][ny] == 0:
1818
visited[nx][ny] = 1
19-
dp[nx][ny] = min(dp[nx][ny], count + 1)
19+
dp[nx][ny] = count + 1
2020
q.append((nx, ny, count + 1))
2121

2222

@@ -27,7 +27,7 @@ def bfs(x, y, count): # x -> row | y -> col
2727
arr = [[0] * n for __ in range(n)]
2828
dp = [[INF] * n for __ in range(n)]
2929
visited = [[0] * n for __ in range(n)]
30-
visited[0][0] = 1
30+
visited[start[0]][start[1]] = 1
3131
start = list(map(int, input().split()))
3232
dest = list(map(int, input().split()))
3333

0 commit comments

Comments
 (0)