[백준] 22116번 - 창영이와 퇴근 (파이썬)
# 창영이와 퇴근 import sys import heapq N = int(input()) arr = [list(map(int, input().split())) for _ in range(N)] dx = [0, 1, 0, -1] dy = [1, 0, -1, 0] visited = [[sys.maxsize for _ in range(N)]for _ in range(N)] def dijkstra(a, b): q = [] heapq.heappush(q, (0, a, b)) visited[a][b] = 0 while q: height, x, y = heapq.heappop(q) if visited[x][y] < height: continue for k in range(4): nx = x + dx[k] ny = ..
2022. 4. 12.