[파이썬] 백준 6593번: 상범 빌딩
from collections import deque dh = [-1, 1, 0, 0, 0, 0] # 상하좌우앞뒤 dx = [0, 0, 0, 0, 1, -1] dy = [0, 0, -1, 1, 0, 0] def BFS(h, x, y): # h: 높이, x: 앞뒤, y: 좌우 global answer for d in range(6): H = h + dh[d] X = x + dx[d] Y = y + dy[d] if 0
2020. 5. 18.