QOJ.ac

QOJ

Süre Sınırı: 2 s Bellek Sınırı: 256 MB Toplam puan: 100

#22531. Liczenie krów

İstatistikler

Źródło: Angielska kopia oryginalnej treści: https://ac.nowcoder.com/acm/problem/25075

Porównanie z archiwum: work/usaco_2007/open07/archive/analysis/analysis/OPEN07.count.htm i work/usaco_2007/open07/archive/testdata/count.1.in / .out.

Farmer John chce ponumerować $N$ krów, ale nie lubią one mieć na sobie cyfry $L$, więc jej unika.

Krowy dostają $N$ najmniejszych dodatnich liczb całkowitych, których zapis dziesiętny nie zawiera cyfry $L$. Jaki największy numer Farmer John musi napisać?

Wejście

Pierwszy wiersz zawiera dwie liczby całkowite $N$ i $L$ oddzielone spacją, gdzie $1 \le N \le 1{,}000{,}000$ i $0 \le L \le 9$.

Wyjście

Wypisz jedną liczbę całkowitą: największą liczbę, którą Farmer John musi napisać na jakiejkolwiek krowie.

Przykład

Wejście 1

10 1

Wyjście 1

22

Uwagi

Pierwsze dziesięć dodatnich liczb całkowitych bez cyfry 1 to 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.