[20250611] BOJ / G3 / ACM Craft / 설진영 #345
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/1005
🧭 풀이 시간
45분
👀 체감 난이도
✏️ 문제 설명
건물 간 의존성이 있는 상황에서 특정 건물을 완성하는 데 필요한 최소 시간을 구하는 문제. 선행 건물들이 모두 완성되어야 다음 건물을 지을 수 있고, 여러 건물은 동시에 건설 가능.
🔍 풀이 방법
기본 위상정렬에 시간 누적 계산을 추가한 형태
위상 정렬이랑 DP 결합
모든 작업이 완료되어야 다음 단계로 넘어갈 수 있기 때문에 가장 오래 걸리는 작업을 기다려함
minTime[next] = Math.max(minTime[next], minTime[current] + buildTime[next])
⏳ 회고
위상정렬과 DP를 결합한 응용 문제라서 생각보다 어려웠음.