파이썬8 [Python] 백준 - 1753번 최단경로(3) 이전글[Python] 백준 - 1753번 최단경로(2) [Python] 백준 - 1753 최단경로(2)이전글[Python] 백준 - 1753번 최단경로(1) [Python] 백준 - 1753번 최단경로(1)문제백준 1753번최종 코드import sysimport mathfrom collections import dequeinput = sys.stdin.readlineV, E = map(int, input().split())visited = [False] * (Vdevfromyoung.tistory.com문제백준 1753번최종 코드pypy3, Python3 모두 동작!import sysimport mathimport heapqinput = sys.stdin.readlineV, E = map(int, inp.. 2024. 5. 28. [Python] 백준 - 1753번 최단경로(2) 이전글[Python] 백준 - 1753번 최단경로(1) [Python] 백준 - 1753번 최단경로(1)문제백준 1753번최종 코드import sysimport mathfrom collections import dequeinput = sys.stdin.readlineV, E = map(int, input().split())visited = [False] * (V + 1)distance = [math.inf] * (V + 1)g = [[] for _ in range(V + 1)]k = int(input())distance[k]devfromyoung.tistory.com문제백준 1753번최종 코드Python3에서만 동작import sysimport mathfrom queue import PriorityQue.. 2024. 5. 25. [Python] 백준 - 1753번 최단경로(1) 문제백준 1753번최종 코드import sysimport mathfrom collections import dequeinput = sys.stdin.readlineV, E = map(int, input().split())visited = [False] * (V + 1)distance = [math.inf] * (V + 1)g = [[] for _ in range(V + 1)]k = int(input())distance[k] = 0for _ in range(E): u, v, w = map(int, input().split()) g[u].append((v, w))def find_min_distance_node(): min_distance = math.inf node_num = -1 .. 2024. 5. 24. [Python] 백준 1948번 - 임계경로 문제백준 1948번최종 코드import sysfrom collections import dequeinput = sys.stdin.readlinen = int(input())m = int(input())routes = [[] for _ in range(n + 1)]degree = [0] * (n + 1)reversed_routes = [[] for _ in range(n + 1)]max_time = [0] * (n + 1)for _ in range(m): s, e, t = map(int, input().split()) routes[s].append((e, t)) degree[e] += 1 reversed_routes[e].append((s, t))start, end = map(int,.. 2024. 5. 15. 이전 1 2 다음