Skip to content

Commit 2fd8fe2

Browse files
authored
Update 5.py
1 parent a4fc5f9 commit 2fd8fe2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

9/5.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ def dijkstra(start):
4141
count = 0
4242
# 도달할 수 있는 노드 중에서, 가장 멀리 있는 노드와의 최단 거리
4343
max_distance = 0
44-
for x in distance:
44+
for d in distance:
4545
# 도달할 수 있는 노드인 경우
46-
if x != 1e9:
46+
if d != 1e9:
4747
count += 1
48-
max_distance = max(max_distance, x)
48+
max_distance = max(max_distance, d)
4949

5050
# 시작 노드는 제외해야 하므로 count - 1을 출력합니다.
5151
print(count - 1, max_distance)

0 commit comments

Comments
 (0)