QOJ.ac

QOJ

実行時間制限: 10 s メモリ制限: 1024 MB 満点: 20

#12266. 整洁数

統計

Tatiana 喜欢保持事物整洁。她的玩具按从小到大排序,铅笔按从短到长排序,电脑按从旧到新排序。有一天,在练习数数时,她注意到一些整数在十进制表示下(无前导零)其数字呈非递减顺序排列。例如 8、123、555 和 224488。她决定将这些数字称为“整洁数”(tidy numbers)。而不具备此性质的数字,如 20、321、495 和 999990,则不是整洁数。

她刚刚完成了从 1 到 $N$ 的所有正整数的升序计数。请问她数出的最后一个整洁数是多少?

样例

输入格式 1

4
132
1000
7
111111111111111110

输出格式 1

Case #1: 129
Case #2: 999
Case #3: 7
Case #4: 99999999999999999

说明

注意,最后一个样例不会出现在小型数据集中。

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.