QOJ.ac

QOJ

시간 제한: 2 s 메모리 제한: 256 MB 총점: 100

#22531. 소 세기

통계

출처: 원문 문제의 영어 미러: https://ac.nowcoder.com/acm/problem/25075

아카이브 교차 확인: work/usaco_2007/open07/archive/analysis/analysis/OPEN07.count.htm 및 work/usaco_2007/open07/archive/testdata/count.1.in / .out.

Farmer John은 $N$마리 소에 번호를 쓰려고 합니다. 소는 몸에 숫자 $L$이 쓰이는 것을 싫어하므로 그 숫자를 피합니다.

소에게 십진수 표현에 숫자 $L$이 없는 가장 작은 양의 정수 $N$개를 부여합니다. Farmer John이 써야 할 가장 큰 번호는 무엇인가요?

입력

첫째 줄은 공백으로 구분한 두 정수 $N$과 $L$이며 $1 \le N \le 1{,}000{,}000$이고 $0 \le L \le 9$입니다.

출력

정수 하나를 출력하세요. Farmer John이 어느 소에게든 써야 할 수 중 가장 큰 수입니다.

예제

입력 1

10 1

출력 1

22

참고

숫자 1이 없는 처음 열 개의 양의 정수는 2, 3, 4, 5, 6, 7, 8, 9, 20, 22.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.