QOJ.ac

QOJ

حد الوقت: 2 s حد الذاكرة: 2048 MB مجموع النقاط: 100

#8251. 缺失的数字

الإحصائيات

Kirby 按顺序写下了从 $a$ 到 $b$ 的所有整数。他将这些整数写成了一个大字符串,中间没有空格,也没有前导零,但他没有告诉你 $a$ 和 $b$ 的值!

因为 Kirby 饿了,他吃掉了其中的一个数字。你能找出他吃掉了哪个数字吗?

输入格式

第一行包含一个整数 $t$ ($1 \le t \le 10^5$),表示测试用例的数量。

接下来的 $t$ 行,每行包含一个长度至少为 1 且最多为 488888 的数字字符串。这个字符串就是 Kirby 写下的内容。注意 $1 \le a < b \le 99999$。保证该字符串可以通过上述过程得到。

保证所有字符串的长度之和不超过 $10^6$。

输出格式

输出 $2t$ 行,每个测试用例占两行。

第一行输出一个整数,表示 Kirby 可能吃掉的数字的数量。

第二行按升序输出 Kirby 可能吃掉的数字,数字之间至少用一个空格分隔。

样例

样例输入 1

1
891112

样例输出 1

1
10

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.