Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite56d409

Browse files
authored
Update 5.py
1 parenta0ff686 commite56d409

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎18/5.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@
5959
now=q.popleft()
6060
result.append(now)
6161
# 해당 원소와 연결된 노드들의 진입차수에서 1 빼기
62-
foriinrange(1,n+1):
63-
ifgraph[now][i]:
64-
indegree[i]-=1
62+
forjinrange(1,n+1):
63+
ifgraph[now][j]:
64+
indegree[j]-=1
6565
# 새롭게 진입차수가 0이 되는 노드를 큐에 삽입
66-
ifindegree[i]==0:
67-
q.append(i)
66+
ifindegree[j]==0:
67+
q.append(j)
6868

6969
# 사이클이 발생하는 경우(일관성이 없는 경우)
7070
ifcycle:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp