[백준] 2252 : 줄 세우기 (파이썬)
·
Algorithm/Sort
위상정렬 문제https://www.acmicpc.net/problem/2252💡 풀이코드 (성공)import sys from collections import deque V, E = map(int, sys.stdin.readline().split())graph = [[] for _ in range(V + 1)]degree = [0] * (V + 1)for i in range(E): v1, v2 = map(int, sys.stdin.readline().split()) graph[v1].append(v2) degree[v2] += 1def topological_sort(V, E, graph, degree): queue = deque() result = [] for i in ..
_은선_
'Algorithm/Sort' 카테고리의 글 목록