Skip to content

Conversation

@oncsr
Copy link
Contributor

@oncsr oncsr commented Nov 5, 2025

🧷 문제 링크

https://www.acmicpc.net/problem/3429

🧭 풀이 시간

30분

👀 체감 난이도

✏️ 문제 설명

길이 N인 수열에서 임의의 연속한 구간 하나를 지웠을 때, 가장 긴 연속하는 증가 부분 수열의 길이를 구해보자.

🔍 풀이 방법

cnt[i] = i번째 원소 a[i]를 마지막으로 하는 가장 긴 연속 증가 부분 수열의 길이

(a[i], i) 리스트 만들어놓고 a[i]의 오름차순대로 (a[i], i) 쌍을 하나씩 처리
-> cnt2[i] = max(cnt[1], ..., cnt[i-1]) + 1
이걸로 연속한 구간 하나를 날려버리는 작업은 끝

연속한 구간을 날린 후에 증가 부분 수열이 뒤로 더 생길 수 있으니까
cnt2에서 한 번 돌면서 a[i-1] < a[i]인 i에 대해 cnt2[i] = max(cnt2[i], cnt2[i-1] + 1) 수행

답은 max(cnt2)로 구함.

⏳ 회고

생각보다 까다로움

@oncsr oncsr self-assigned this Nov 5, 2025
@oncsr oncsr added the success 👍 해설을 보지 않고 풀었을 때 label Nov 5, 2025
@ShinHeeEul ShinHeeEul merged commit 66d47ba into main Nov 5, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

success 👍 해설을 보지 않고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants