[20251127] BOJ / P3 / 認証レベル / 권혁준 #1522
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/5574
🧭 풀이 시간
30분
👀 체감 난이도
✏️ 문제 설명
2개의 격자 형태 사무소가 있고, 각 방마다 기밀 레벨이 있다. 각 사무소의 엘리베이터 홀에서 시작하여, 신분증의 인증 레벨이 방의 기밀 레벨 이상일 때 입장할 수 있다. 두 사무소를 합쳐 R개 이상의 방을 방문할 수 있도록 하는 두 신분증 인증 레벨의 합의 최솟값을 구하는 문제이다.
🔍 풀이 방법
각 사무소의 방들을 (x, y, k)로 나타내었을 때, 보안 레벨 k를 기준으로 오름차순 정렬한다.
보안 레벨을 기준으로 스위핑하며 시작점을 기준으로 레벨 별 영역의 크기를 구한다.
투 포인터로 R이 넘는 최소 레벨 합을 구한다.⏳ 회고
ez