QOJ.ac

QOJ

Límite de tiempo: 2 s Límite de memoria: 256 MB Puntuación total: 100

#22531. Đếm bò

Estadísticas

Nguồn: Bản sao tiếng Anh của đề gốc: https://ac.nowcoder.com/acm/problem/25075

Đối chiếu kho lưu trữ: work/usaco_2007/open07/archive/analysis/analysis/OPEN07.count.htm và work/usaco_2007/open07/archive/testdata/count.1.in / .out.

Farmer John muốn đánh số $N$ con bò, nhưng chúng không thích chữ số $L$ được viết lên mình, nên ông tránh nó.

Bò nhận $N$ số nguyên dương nhỏ nhất có biểu diễn thập phân không chứa chữ số $L$. Số lớn nhất Farmer John phải viết là gì?

Dữ liệu vào

Dòng đầu gồm hai số nguyên $N$ và $L$ cách nhau bởi khoảng trắng, với $1 \le N \le 1{,}000{,}000$ và $0 \le L \le 9$.

Dữ liệu ra

In một số nguyên: số lớn nhất Farmer John phải viết lên bất kỳ con bò nào.

Ví dụ

Dữ liệu vào 1

10 1

Dữ liệu ra 1

22

Ghi chú

Mười số nguyên dương đầu tiên không có chữ số 1 là 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.