QOJ.ac

QOJ

時間限制: 10 s 記憶體限制: 1024 MB 總分: 23

#5994. 获取数字

统计

你在国际益智会议上结识了一位新朋友,并向对方索要了联系方式。第二天,你在酒店房门下发现了一张字条:

“问候,新朋友!我把电话号码中的每一个数字都替换成了对应的英文大写拼写(数字 0 到 9 依次对应 "ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE"),然后将这些字母以某种方式重新排列,组成了一个字符串 $S$。现在需要你根据 $S$ 来推断我的电话号码包含多少个数字以及具体是哪些数字。我可以告诉你的是,我的电话号码是由这些数字按非递减顺序排列组成的。给我打电话吧……如果你能做到的话!”

你很想给这位朋友打电话,告诉他这种提供电话号码的方式实在太令人讨厌了,但你必须先得到他的电话号码才能拨通!那么,这个号码是多少?

输入格式

输入的第一行包含测试用例的数量 $T$。接下来有 $T$ 个测试用例。每个测试用例由一行包含大写英文字母的字符串 $S$ 组成。

输出格式

对于每个测试用例,输出一行 Case #x: y,其中 $x$ 是测试用例编号(从 1 开始),$y$ 是由数字组成的字符串:即电话号码。

数据范围

$1 \le T \le 100$。 保证存在唯一解。

小型数据集(测试集 1 - 可见)

$3 \le \text{length of } S \le 20$。

大型数据集(测试集 2 - 隐藏)

$3 \le \text{length of } S \le 2000$。

样例

输入格式 1

4
OZONETOWER
WEIGHFOXTOURIST
OURNEONFOE
ETHER

输出格式 1

Case #1: 012
Case #2: 2468
Case #3: 114
Case #4: 3

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.