[20251022] BOJ / G3 / 난개발 / 한종욱 #1192
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/19584
🧭 풀이 시간
60분
👀 체감 난이도
✏️ 문제 설명
도로의 통행량이 주어진다. 도로를 철거할 때, 통행량을 최대한 많이 막았다고 한다면 최대로 많이 막은 통행량을 출력하라.
🔍 풀이 방법
도로를 y기준으로 정렬하고 이벤트로 바꿔서 스위핑해 푼다.
⏳ 회고
스위핑은 투포인터와 다른 점이 있다. 어려운 스위핑은 '추가', '삭제' 처럼 각 행위를 이벤트로 처리해 해당 이벤트가 들어올 때마다 처리하는 방식을 사용한다.