[20250404] BOJ / G3 / 홍익 투어리스트 / 권혁준 #297
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/23326
🧭 풀이 시간
13분
👀 체감 난이도
✏️ 문제 설명
N개의 구역이 1번부터 N번까지 시계 방향을 이루며 원형으로 배치되어 있다.

도현이는 처음에 1번 구역에 서있다.
아래 쿼리를 수행하는 프로그램을 작성해보자.
🔍 풀이 방법
[사용한 알고리즘]
명소로 지정되어 있는 인덱스만 TreeSet에 존재하도록 관리한다.
1번 쿼리는 contains함수로 명소 여부를 판별해 remove 혹은 add로 처리할 수 있다.
2번 쿼리는 모듈로 연산으로 처리할 수 있다.
3번 쿼리는 TreeSet의 ceiling함수로 처리할 수 있다.
⏳ 회고
ceiling, floor, higher, lower 함수에 대해 새로 알게 되었다