Illustration by: Mike Holmesfour, used under CC Attribution Noncommercial 3.0 Unported License
Rookie Pirate Captain Jack Albatross has secretly laid anchor in a hidden bay not far from PortWine, the local meeting point for grizzled pirates and denizens of the sea. Disguising as a messenger, you have infiltrated the service of the dreaded legendary Captain Stevie, and you are entrusted with carrying small encrypted messages between Captain Stevie and his staff of shipmates. Your task is to break the encryption of the messages in aid of young Captain Albatross, giving him a much needed edge in his quest for peg-legged fame. Fortunately, you (in contrast to Captain Albatross) have been around for a while and you’ve come to know what words to expect in written pirate messages. The following is a table of words having common occurrences:
“be” “our” “rum” “will” “dead” “hook” “ship” “blood” “sable” “avenge” “parrot” “captain”In a (mixed alphabet) substitution cipher, each letter of the plain text is replaced with another, in this case arbitrary but unique, letter from the alphabet. Given a text encrypted with a substitution cipher and the given set of the twelve known words above, your task is to decode the encrypted text and provide us and Captain Albatross with the plain text. This can be accomplished if and only if there is a unique substitution mapping from the encrypted letters to plain text letters such that
The encrypted text is given on one line containing at most 200 characters from the set [’a’-’z’,’ ’]. Only the letters [’a’-’z’] of the plain text are encrypted, the spaces are kept unencrypted.
입력 ex eoii jpxbmx cvz uxju sjzzcn jzz 출력 we will avenge our dead parrot arr 입력 wl jkd 출력 Impossible 입력 dyd jkl cs 출력 Impossible
출처:ncpc/2012/Problem I