diff --git "a/H0ngJu/BFS/\354\225\204\352\270\260\354\203\201\354\226\264.py" "b/H0ngJu/BFS/\354\225\204\352\270\260\354\203\201\354\226\264.py" new file mode 100644 index 0000000..70ef070 --- /dev/null +++ "b/H0ngJu/BFS/\354\225\204\352\270\260\354\203\201\354\226\264.py" @@ -0,0 +1,64 @@ +import sys +from collections import deque + +def input() : return sys.stdin.readline().rstrip() + +N = int(input()) +space = [list(map(int, input().split())) for _ in range(N)] + +dir = [(0,1), (0,-1), (1,0), (-1,0)] +x = 0 +y = 0 + +for i in range(N): + for j in range(N): + if space[i][j] == 9: + x, y = i, j + space[x][y] = 0 + +def check(a, b): + if 0<=a