QOJ.ac

QOJ

実行時間制限: 2 s メモリ制限: 256 MB 満点: 100

#22531. Kühe zählen

統計

Herkunft: Englische Kopie der ursprünglichen Aufgabenstellung: https://ac.nowcoder.com/acm/problem/25075

Abgleich mit dem Archiv: work/usaco_2007/open07/archive/analysis/analysis/OPEN07.count.htm und work/usaco_2007/open07/archive/testdata/count.1.in / .out.

Farmer John möchte seine $N$ Kühe nummerieren. Sie mögen jedoch die Ziffer $L$ nicht auf ihrem Körper, daher vermeidet er sie.

Die Kühe erhalten die $N$ kleinsten positiven ganzen Zahlen, deren Dezimaldarstellung die Ziffer $L$ nicht enthält. Welche größte Nummer muss Farmer John schreiben?

Eingabe

Die erste Zeile enthält zwei durch Leerzeichen getrennte Ganzzahlen $N$ und $L$, mit $1 \le N \le 1{,}000{,}000$ und $0 \le L \le 9$.

Ausgabe

Gib eine Ganzzahl aus: die größte Zahl, die Farmer John auf irgendeine Kuh schreiben muss.

Beispiele

Eingabe 1

10 1

Ausgabe 1

22

Hinweis

Die ersten zehn positiven ganzen Zahlen ohne die Ziffer 1 sind 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.