https://www.acmicpc.net/problem/13565 DFS나 BFS로 풀면 된다. 검색해서 가장 먼저 보이는 소스가 BFS여서 BFS로품 def bfs(y,x): visited = [[0 for j in xrange(n)] for i in xrange(m)] q = Queue.Queue() q.put([y,x]) visited[y][x] = 1 while not q.empty(): p = q.get() if p[0]==m-1: return True for i in xrange(3): ty,tx = p[0]+[1,0,0,-1][i],p[1]+[0,-1,1,0][i] if tyn-1: continue if visited[ty][tx]==0 and arr[ty][tx]==0: q.put([ty..