Skip to content

Commit 63a6d0b

Browse files
authored
Kcm boj laptop (#68)
* 찬민 백준숙제 * 백준 7562
1 parent f2b8aef commit 63a6d0b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmkim/BaekJoon/백준_7562.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +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+
1920
dp[nx][ny] = count + 1
2021
q.append((nx, ny, count + 1))
2122

@@ -27,9 +28,12 @@ def bfs(x, y, count): # x -> row | y -> col
2728
arr = [[0] * n for __ in range(n)]
2829
dp = [[INF] * n for __ in range(n)]
2930
visited = [[0] * n for __ in range(n)]
30-
visited[start[0]][start[1]] = 1
31+
32+
3133
start = list(map(int, input().split()))
3234
dest = list(map(int, input().split()))
35+
visited[start[0]][start[1]] = 1
36+
3337

3438
q = deque()
3539
q.append((start[0], start[1], 0))

0 commit comments

Comments
 (0)