경쟁 프로그래밍쉬움

n자리의 비감소 숫자

'n자리 숫자가 감소하지 않는 숫자' 문제에 대한 자세한 가이드 및 Python 구현입니다.

문제 설명

쉬움

n 자리로 감소하지 않는 숫자의 개수를 반환하는 함수 count_non_decreasing(n)을 작성하세요. 모든 숫자가 왼쪽 숫자보다 크거나 같으면 숫자는 감소하지 않습니다. 앞에 0이 허용됩니다(예: 012는 감소하지 않음).

제약
  • 1 <= n <= 20

Example 1
Input
count_non_decreasing(1)
Output
10
Explanation

All single digit numbers (0 to 9) are non-decreasing.

Example 2
Input
count_non_decreasing(2)
Output
55
Explanation

There are 55 non-decreasing numbers of 2 digits (like 00, 01, ..., 11, 12, ..., 99).

Need a Hint?
세트나 힙과 같은 동적 프로그래밍 관련 데이터 구조를 사용해 보세요.
Edge Cases to Watch
  • 빈 입력 구조
  • 단일 요소 입력
  • 큰 수치 범위

해결할 준비가 되셨나요?

Open the problem in PyRun's browser-based Python editor. Your code runs fully offline — no server required.

편집기에서 열기
Found this breakdown helpful?

PyRun is built and maintained by an independent solo developer. If this helped your interview prep, consider buying a coffee!

Buy me a coffee

권장 Python 리소스

관련 대화형 튜토리얼, 치트 시트, 코드 비교를 통해 지식을 확장하세요.