[20251209] BOJ / G1 / K번째 수 / 이준희 #1624
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/1300
🧭 풀이 시간
80분
👀 체감 난이도
✏️ 문제 설명
NN 짜리 배열 A 에서 A[i][j] = ij 일 때
이 배열을 일차원으로 만들고 오름차순 정렬했을 때
K번째 숫자를 찾는 문제입니다.
🔍 풀이 방법
이분탐색을 이용해서 풀었습니다.
K번째 수를 찾아야하기 때문에 중간값(mid)보다 작은 값이 K개와 비교하여 작은지, 큰지에 따라서 갱신했습니다.
⏳ 회고
호기롭게 도전했다가 고전했던 문제입니다.
N이 10만으로 크기 때문에 실제 배열을 정의하지 못하는 문제였습니다.