Skip to content

Commit 3044514

Browse files
authored
Update 6.py
1 parent ede4d0c commit 3044514

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

10/6.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
# 방향 그래프의 모든 간선 정보를 입력 받기
1111
for _ in range(e):
1212
a, b = map(int, input().split())
13-
graph[a].append(b)
13+
graph[a].append(b) # 정점 A에서 B로 이동 가능
1414
# 진입 차수를 1 증가
1515
indegree[b] += 1
1616

1717
# 위상 정렬 함수
1818
def topology_sort():
1919
result = [] # 알고리즘 수행 결과를 담을 리스트
2020
q = deque() # 큐 기능을 위한 deque 라이브러리 사용
21+
2122
# 처음 시작할 때는 진입차수가 0인 노드를 큐에 삽입
2223
for i in range(1, v + 1):
2324
if indegree[i] == 0:

0 commit comments

Comments
 (0)