Sphere Online Judge

SPOJ Problem Set (classical)

2009. Cryptography

Problem code: CRYPTO

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.

Blue Mary's note: 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.


Added by:[Trichromatic] XilinX
Date:2007-11-03
Time limit:1s-11s
Source limit:50000B
Memory limit:256MB
Cluster: Pyramid (Intel Pentium III 733 MHz)
Languages:All except: C99 strict ERL JS
Resource:Sadly, the ability to make a simple problem difficult to understand is seldom considered a talent.

hide comments
2013-05-15 09:53:33 ooops
WHAT IS MEANT BY (IN THE ORIGINAL PROBLEM DESCRIPTION)
2013-02-18 23:58:24 Mitch Schwartz
@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".
2013-02-18 21:37:06 joud zouzou
"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 16:09:11
2012-12-28 13:25:15 Mostafa 36a2 (Al3ayesh)
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 19:50:58
2012-05-20 08:38:43 Alex Anderson
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 08:41:55
2012-05-19 10:05:12 Damian Straszak
Worst problem ever, the description is full of ambiguities.
2012-05-09 13:17:44 Andrew
Does frequency analysis work, or do you just have to brute force it?
2012-05-06 11:55:35 Petar Veličković
Agree completely. I wasted a lot of time trying to figure out the deciphered text completely right.
Finally AC after 3 pages of submissions :)

Last edit: 2012-05-06 11:55:51
2012-05-05 18:01:10 Goran Zuzic
Worst. Problem. Ever.
Really, don't bother after you've deciphered the text file :)
2012-05-01 21:29:17 Pawel Gawrychowski
Evil indeed!
SPOJ © 2013 Sphere Research Labs. All Rights Reserved.