백준 17836 - 공주 구출 [bfs]
""" 17836 백준 """ from collections import deque H, W, T = map(int, input().split()) arr = [list(map(int, input().split())) for i in range(H)] dirs = [ [0,1], [1,0], [0,-1], [-1,0] ] def bfs(): visited = [[False for i in range(W)] for j in range(H)] visitSword = [[False for i in range(W)] for j in range(H)] q = deque([[0,0,0,0]]) visited[0][0] = True while q: y, x, t, sword = q.popleft() if y == H..
더보기