[20250620] BOJ / P5 / 가장 긴 증가하는 부분 수열 5 / 이강현 #373
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/14003
🧭 풀이 시간
60분
👀 체감 난이도
✏️ 문제 설명
가장 긴 증가하는 부분 수열(LIS)의 길이와 LIS 자체를 출력.
N은 최대 100만
🔍 풀이 방법
이분 탐색
LIS 배열을 이분 탐색을 통하여 만들기(nlogn)
LIS의 특정 인덱스와 매핑되는 실제 arr의 인덱스를 저장.
arr의 특정 원소를 마지막으로 하여 만들 수 있는 LIS의 길이를 저장.
LIS 배열의 길이가 결국 LIS의 길이라는 점을 이용하여 값을 1씩 줄여가며 값을 출력.
⏳ 회고
헷갈려....