比赛场次 | 128 |
---|---|
比赛名称 | 2012 资格赛 |
比赛状态 | 已结束比赛成绩 |
开始时间 | 2012-04-15 14:00:00 |
结束时间 | 2012-04-15 18:00:00 |
开放分组 | 全部用户 |
注释介绍 | Google Code Jam - 资格赛 2012 |
题目名称 | 奇怪的语言 |
---|---|
输入输出 | 2012a.in/out |
时间限制 | 1000 ms (1 s) |
内存限制 | 128 MiB |
测试点数 | 1 简单对比 |
用户 | 结果 | 时间 | 内存 | 得分 |
---|---|---|---|---|
Makazeu | A | 0.000 s | 0.00 MiB | 100 |
王者自由 | A | 0.000 s | 0.00 MiB | 100 |
We have come up with the best possible language here at Google, called Googlerese. To translate text into Googlerese, we take any message and replace each English letter with another English letter. This mapping isone-to-oneandonto, which means that the same input letter always gets replaced with the same output letter, and different input letters always get replaced with different output letters. A letter may be replaced by itself. Spaces are left as-is.
For example (and here is a hint!), our awesome translation algorithm includes the following three mappings: 'a' -> 'y', 'o' -> 'e', and 'z' -> 'q'. This means that "a zoo" will become "y qee".
Googlerese is based on the best possible replacement mapping, and we will never change it. It will always be the same. In every test case. We will not tell you the rest of our mapping because that would make the problem too easy, but there are a few examples below that may help.
Given some text in Googlerese, can you translate it to back to normal text?
Usually, Google Code Jam problems have 1 Small input and 1 Large input. This problem has only1 Small input. Once you have solved the Small input, you have finished solving this problem.
The first line of the input gives the number of test cases,T.Ttest cases follow, one per line.
Each line consists of a stringGin Googlerese, made up of one or more words containing the letters 'a' - 'z'. There will be exactly one space (' ') character between consecutive words and no spaces at the beginning or at the end of any line.
For each test case, output one line containing "Case #X:S" whereXis the case number andSis the string that becomesGin Googlerese.
1 ≤T≤ 30.
Gcontains at most 100 characters.
None of the text is guaranteed to be valid English.
Input |
3 ejp mysljylc kd kxveddknmc re jsicpdrysi rbcpc ypc rtcsra dkh wyfrepkym veddknkmkrkcd de kr kd eoya kw aej tysr re ujdr lkgc jv |
|
Output |
Case #1: our language is impossible to understand Case #2: there are twenty six factorial possibilities Case #3: so it is okay if you want to just give up |