Skip to content

Conversation

@suyeun84
Copy link
Contributor

🧷 문제 링크

https://www.acmicpc.net/problem/2056

🧭 풀이 시간

30분

👀 체감 난이도

✏️ 문제 설명

수행해야 할 작업 N개가 있을 때, 선행 관계가 존재함.
서로 선행 관계가 없는 작업들은 동시에 수행이 가능할 때, 모든 작업을 완료하기 위한 최소 시간 구하기

🔍 풀이 방법

위상 정렬 사용
degree배열에 각 작업 별로 선행되어야 할 작업이 몇 개 있는지 저장해두고, 0인 애들을 큐에 넣어서 해당 작업이 완료되기까지 걸리는 가장 긴 시간을 result 배열에 저장해서 구함
result 배열을 while문 안에서 바로바로 갱신했는데, 그러면 degree가 처음부터 0인 애들을 고려 못해서 다 끝나고 확인해줘야 함

⏳ 회고

위상 정렬 오랜만에 푸니까 헷갈렸다..

@suyeun84 suyeun84 self-assigned this Oct 29, 2025
@suyeun84 suyeun84 added the success 👍 해설을 보지 않고 풀었을 때 label Oct 29, 2025
@suyeun84 suyeun84 merged commit a5434bf into main Oct 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

success 👍 해설을 보지 않고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants