• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • YouClaw
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
HaibaraAi
博客园    首页    新随笔    联系   管理    订阅  订阅

Codechef Code Crunch 2013 Dumbledore Army

 

Dumbledore Army

Problem code: MRIU13

 
  • Submit
  • My Submissions
  • All Submissions
 

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 }
View Code 2013-10-25 15:20:49
posted @ 2013-10-25 15:22  HaibaraAi  阅读(78)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3