QOJ.ac

QOJ

Limite de temps : 2 s Limite de mémoire : 256 MB Points totaux : 100

#22531. ספירת פרות

Statistiques

מקור: עותק אנגלי של הנוסח המקורי: 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$, ולכן הוא נמנע ממנה.

הפרות מקבלות את $N$ המספרים השלמים החיוביים הקטנים ביותר שייצוגם העשרוני אינו מכיל את הספרה $L$. מהו המספר הגדול ביותר שעל 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.