CRYPTO - Cryptography


Your task is to work as a cryptographer for some time, the reason is ...

Blue Mary has set a problem using English. Since the problem is too easy and it will be boring when solving it, she has deleted all the whitespaces and punctuations in the original problem description, and lowercased all the capital Latin letters. Then, she randomly chose a permutation of the English lowercase letter alphabet, and then used the corresponding letters in place of the letters in the original text.

The encrypted text can be downloaded here.

There is no example for this problem.

Some tricky test cases were added on Nov. 25th, 2007 and the time limit has been changed. Programs have been rejudged and some "accepted" solutions got Wrong Answer. However, this problem can still be solved by quite clean code with length less than 1KB.


hide comments
noble_mushtak: 2019-06-25 18:32:47

Description is definitely ambiguous, but it did not take me too long to figure out what it meant. However, for me, the time limit was a big factor because the language I originally tried to solve this problem in was too slow. Thus, I had to figure out how to solve this problem in C, which was a very big learning opportunity. I ultimately ended up with the third-fastest solution (0.05 seconds), so it was definitely worth it.

shade_1: 2015-05-23 09:48:29

Finally AC! Enjoyed deciphering the text :D

liv_curious: 2014-10-24 21:51:43

Deciphering the text is the easy part of this problem!

rafael859: 2014-10-12 13:18:23

I solved it and I am happy and disappointed at the same time (for some reason cin seems to work better than scanf in this problem)

Mostafa 36a2: 2013-05-30 22:41:02

it means the ciphered text is the main problem so that if you have deciphered the text you still have to solve the problem .

ooops: 2013-05-15 07:53:33

WHAT IS MEANT BY (IN THE ORIGINAL PROBLEM DESCRIPTION)

Mitch Schwartz: 2013-02-18 22:58:24

@joud zouzou: Suppose for simplicity our alphabet is only (a,b,c,d,e) and our permutation is (b,d,a,e,c), so "a" maps to "b", "b" maps to "d", "c" maps to "a", "d" maps to "e", "e" maps to "c". So for example the word "bad" would be replaced by "dbe".

joud zouzou: 2013-02-18 20:37:06

"Then, she randomly chose a permutation of the English lowercase letter alphabet, and then used the corresponding letters in place of the letters in the original text."
didnt understand that, any help would be appreciated

thanks very much mitch

Last edit: 2013-02-19 15:09:11
Mostafa 36a2: 2012-12-28 12:25:15

it takes 2days for deciphering...
and 8 pages of All kinds WA/TLE runtime errors

At last ACCEPTED :O .
i can say that the deciphered problem is 100%correct ,
any thing seems clear is really clear , don't change your mind after the first time you got it .

Last edit: 2013-01-16 18:50:58
Alex Anderson: 2012-05-20 06:38:43

Ugh, didn't like this because of the slight ambiguity, but whatever. Advice: since it is ambiguous, make sure you can handle input of all sizes. And be quick about it.

Don't be afraid to just submit a solution to simply test features of the input. But be warned that the things you discover may only apply to the first test case.

Also, my code length is 3.4k. 145 lines in Java. It is clean, but I made my own functions for what the encrypted text asks you to do.

Last edit: 2012-05-20 06:41:55

Added by:Fudan University Problem Setters
Date:2007-11-03
Time limit:2s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: C99 ERL GOSU JS-RHINO
Resource:Sadly, the ability to make a simple problem difficult to understand is seldom considered a talent.