Skip to content

Conversation

@lkhyun
Copy link
Contributor

@lkhyun lkhyun commented Jun 21, 2025

🧷 문제 링크

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

🧭 풀이 시간

60분

👀 체감 난이도

✏️ 문제 설명

N자리 수가 계단 수를 만족하고 0~9까지의 모든 숫자를 포함하는 경우의 수를 출력.
여기서 계단 수란, 수의 각 자리 숫자가 인접한 자리 숫자와의 차이가 1인 경우를 말한다.

🔍 풀이 방법

dp + 비트마스킹
N 자리수의 경우의 수는 N-1 자리 수에서 맨 끝자리가 09인경우를 모두 더하면 된다.
여기에 비트마스킹을 적용하여 0
9를 모두 포함하는 경우만 모두 더해 출력한다.

⏳ 회고

비트마스킹은 맨날 헷갈려

@lkhyun lkhyun self-assigned this Jun 21, 2025
@lkhyun lkhyun added success 👍 해설을 보지 않고 풀었을 때 hint 💡 반례를 참고했거나 힌트를 얻고 풀었을 때 labels Jun 21, 2025
@ShinHeeEul ShinHeeEul merged commit cc6598a into main Jun 21, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hint 💡 반례를 참고했거나 힌트를 얻고 풀었을 때 success 👍 해설을 보지 않고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants