Skip to content

Conversation

@lkhyun
Copy link
Contributor

@lkhyun lkhyun commented Jan 7, 2026

🧷 문제 링크

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

🧭 풀이 시간

40분

👀 체감 난이도

✏️ 문제 설명

음이아닌 정수를 앞자리부터 봤을때, 숫자가 감소하는 경우 감소하는 수라고 함.
N번째 감소하는 수를 구하자.

🔍 풀이 방법

비트마스킹
매 자릿수가 감소하려면 0~9까지의 숫자가 모두 사용되는 경우까지가 한계이므로
어떤 숫자를 사용할지 비트마스킹으로 표현함.
어떤 숫자를 사용할지가 선택되면 이후에는 내림차순 정렬을 한 것이 유일한 감소하는 수가 됨.

⏳ 회고

비트마스킹은 주어진 것 중에 어떤 것을 사용할지를 비트단위로 표현한 것이라는 생각을 문제 풀때 해보자.

@lkhyun lkhyun self-assigned this Jan 7, 2026
@lkhyun lkhyun added the success 👍 해설을 보지 않고 풀었을 때 label Jan 7, 2026
@ShinHeeEul ShinHeeEul merged commit aa4787c into main Jan 7, 2026
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