[20251103] BOJ / G5 / 콘센트 / 이준희 #1300
Merged
+41
−0
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/23843
🧭 풀이 시간
20분
👀 체감 난이도
✏️ 문제 설명
충전해야되는 전자기기 N 과 충전 가능한 콘센트 개수 M이 주어지고 각 전자기기 완충에 필요한시간이 주어질 때
모든 전자기기을 충전할 수 있는 최소시간을 구하는 문제입니다.
🔍 풀이 방법
우선순위 큐를 활용해서 풀었습니다.
충전에 필요한 시간을 내림차순으로 정렬하고 처음에 M개를 우선순위 큐에 넣습니다.
그 다음부터는 그 값이 작은 것을 꺼내어 필요시간을 계속 더해서 갱신해가면서 풀었습니다.
⏳ 회고
쉽운 문제입니다.