๐ป ๋ฐฑ์ค 2178๋ฒ [๋ฏธ๋กํ์] ํ์ด) # ์ต์ข ์ ์ถ from collections import deque n,m = map(int,input().split()) miro = [list(map(int,input())) for _ in range(n)] visited = [[0]*m for _ in range(n)] dis = [[0]*m for _ in range(n)] q = deque([[0,0]]) visited[0][0] = 1 dis[0][0] = 1 while q : x,y = q.popleft() for [i,j] in [[x+1,y],[x,y+1],[x-1,y],[x,y-1]] : if 0