[20250219] BOJ / 골드4 / 사냥꾼 / 이강현 #149
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/8983
🧭 풀이 시간
60분
👀 체감 난이도
✏️ 문제 설명
x축의 한 점에서 제 1사분면 내에 있는 특정 좌표에 도달할 수 있는지 여부를 확인하는 문제 x축의 한 점을 (x1,0)이라고 할때 (x2,y2)로의 거리는 |x2-x1| + y2로 계산하며 이는 입력받는 L보다 작거나 같을때 도달할 수 있다고 한다.
🔍 풀이 방법
이분탐색
⏳ 회고
시간복잡도를 고려해서 이분탐색까지는 생각해냈으나 1사분면 위의 특정 점들 중 x값이 같고 y값이 다른 점들이 있을 수 있다는 것을 간과하고 Map의 형태로 저장했다가 실패했었다. 리스트로 바꾸어 해결했다.