백준 1261번: 알고스팟 파이썬 코드(다익스트라)
import sys import heapq INF = sys.maxsize x = [0,0,-1,1] y = [-1,1,0,0] n,m = map(int, sys.stdin.readline().split()) visited = [[0 for _ in range(n)]for _ in range(m)] graph = [] dist = [[INF for _ in range(n)] for _ in range(m)] for i in range(m): temp = list(input()) temp = [int(i) for i in temp] graph.append(temp) heap = [] heapq.heappush(heap, [graph[0][0],[0,0]]) while heap: cost, now = hea..