Skip to content

Conversation

@oncsr
Copy link
Contributor

@oncsr oncsr commented Aug 30, 2025

🧷 문제 링크

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

🧭 풀이 시간

40분

👀 체감 난이도

✏️ 문제 설명

길이 N인 수열을 재배열해서 감소등차수열 + 증가등차수열로 만들 수 있는지 알아보자.

🔍 풀이 방법

  • 그리디

수열의 최솟값을 기준으로 두 개의 등차수열을 만들 수 있어야 한다.
그중 하나는 수열을 정렬해서 첫 두 값을 기준으로 만들 수 있다.

나머지 수열은 첫 등차수열에서 사용되지 않은 수들로 만들 수 있는데, 이 때 첫 등차수열의 마지막 값이 여기에 포함될 수도 있다.

이렇게 성공적으로 두 수열이 뽑혔으면 Yes, 아니면 No이다.

⏳ 회고

그리디너무싫다진짜개어렵다
아니어렵진않은데자꾸틀렸다니까걍화만잔뜩남

@oncsr oncsr added the success 👍 해설을 보지 않고 풀었을 때 label Aug 30, 2025
@ShinHeeEul ShinHeeEul merged commit 1d42a8e into main Aug 30, 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