Codechef Code Crunch 2013 Dumbledore Army
|
Dumbledore ArmyProblem code: MRIU13 |
Problem description.
Alice and Bob are being held at Azkaban(Prison). They want to escape and join Dumbledore's Army.
Alice wants to tell Bob about the details of the plan but
wants to keep their escape plan from Dementors(the guards).
So Alice encrypts
the message before passing the chits to Bob's cell.
However Bob was careless
and he disposed the chits in his cell's waste paper bin.
The clever Dementor
found the chits but couldn't make out what they said.
So he hired a computer
programmer to decode the message for him. Please help the Dementor to decypher
the message.
The code key that Alice used for this simple coding is a one for
one character substitution based upon a single arithmetic manipulation of the
printable portion of the ASCII character set.
Input
The Encrypted message in a single line. The maximum number of charaters in a
message is 100.
(DO NOT PRINT ANY PROMPT MESSAGE TO ENTER THE ENCRYPTED
MESSAGE.)
Output
The decrypted message in a single line. (Do not print any other message other than the decrypted message.)
Example
SAMPLE INPUT 1 [YHUZMVYT'[V'HUPTHN\Z'MVYT3 SAMPLE OUTPUT 1 TRANSFORM TO ANIMAGUS FORM,
SAMPLE INPUT 2 HUK'LZJHWL'^OLU'[OL`'IYPUN'MVVK5 SAMPLE OUTPUT 2 AND ESCAPE WHEN THEY BRING FOOD.
1 #pragma comment(linker, "/STACK:1024000000,1024000000") 2 #include <map> 3 #include <queue> 4 #include <vector> 5 #include <string> 6 #include <cstdio> 7 #include <cstring> 8 #include <iostream> 9 #include <algorithm> 10 using namespace std; 11 #define maxn 10005 12 #define mod 1000000007 13 #define ll long long 14 #define INF 0x7fffffff 15 int n, m; 16 char s[maxn]; 17 int main(){ 18 int cas = 1; 19 int t; 20 /*scanf("%d", &t); 21 while (t--){ 22 scanf("%d", &n); 23 printf("%I64d\n", f[n]); 24 }*/ 25 while (~scanf("%s", s)){ 26 for (int i = 0; i < strlen(s); i++)printf(i == n - 1 ? "%c\n" : "%c", s[i] - 7); 27 } 28 return 0; 29 }
浙公网安备 33010602011771号