[20250418] BOJ / G5 / 회의실 배정 / 이강현 #315
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/1931
🧭 풀이 시간
15분
👀 체감 난이도
✏️ 문제 설명
N개의 회의가 있을 때 겹치지 않고 회의실에 배정할때 최대 개수
🔍 풀이 방법
끝나는 시간을 기준으로 정렬
⏳ 회고
워낙 유명한 문제라 쉽게 했는데, 한가지 생각할게 있었다.
끝나는 시간으로 정렬을 하되 같다면 시작시간 기준으로도 정렬을 해야하는 것을 놓쳤다.
3
2 2
1 2
2 3
위와 같은 반례를 실행할 때 끝나는 시간으로만 정렬을 하게 되면 2 2가 처리되고 1 2가 조건에 막혀 처리되지 않았다.