[20250926] BOJ / G4 / 작업 / 이강현 #980
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🧷 문제 링크
https://www.acmicpc.net/problem/2056
🧭 풀이 시간
30분
👀 체감 난이도
✏️ 문제 설명
작업 N개와 선행해야하는 작업들이 존재함.
작업들은 선행되어야하는 작업이 없다는 조건만 성립하면 언제든지 바로 실행가능함.
모든 작업을 끝내는데 걸리는 최소 시간을 구하라.
🔍 풀이 방법
위상 정렬
실행 순서를 출력하는 것이 아니라 모두 다 처리하는데 걸리는 시간을 구하는 것이므로
위상 정렬을 구현하고 우선순위 큐를 추가해서 하나의 작업이 처리된 후 조건이 만족되는 작업들의 우선 순위를 조절한다. 큐에서 꺼내면서 매 순간 최댓값을 업데이트해서 정답을 구하기.
⏳ 회고
ez