秘密信件

TimeLimit:1000MS  MemoryLimit:128MB
64-bit integer IO format:%lld
未提交 | 登录后收藏
Problem Description
Applejack(以下简称AJ)与Coloratura(简称Rara)是一对非常好的笔友,她们相互写信已经有好几年了,她们在信中经常提到她们各自的近况或者关于自己亲人的事,双方一直保持联系至今。

某天AJ收到了来自Rara的一封奇怪的来信,信中除了0和1之外没有任何的内容。不过AJ并没有感到疑惑,因为她们在上次笔友见面时约定好了一种信件的加密方式,以便信件内容的保密。

密文格式如下:

密文分为若干段,每段密文除了最后八位之外,其他部分只包含0和1两个整数,以每八个数字为一组,每段密文开头的第一组和第二组为两个十进制整数p和m(0≤p,m<256)对应的八位二进制整数,后续的每一组数字代表一个被加密的字符。每段密文以11262015作为段尾标志,段尾不做翻译。

对于除第一、二组外的每一组数字,解密操作如下:

先将后七位二进制整数转换为十进制数n,再根据第一位整数opt(0≤opt≤1)进行如下操作:若opt=0,则将n减去p,若opt=1,则将n加上m,最后对照ASCII码表将n转换为解密后的字符。

这样的加密方式有些复杂,以至于忙于苹果园收获季的AJ无暇解密阅读这样的信件,而你又是AJ最信任的朋友之一,于是解密信件的重担就落在了你的身上。
参考资料:
这题样例有问题
Input
有多组测试案例。对于每组案例包含一段连续的以"11262015"结尾(不含引号),其余部分只包含0和1的字符串,输入保证解密后的字符对应的ASCII值大于31且小于127。
Output
根据加密规则输出解密后的信件内容。
SampleInput
0001011001101111110111110000010110000111010001000011011011000011110001111000010111111001010000100011011011000011010001101100001001001011010000100011011011011110011101110000010011110110011111101111001000001010000001011111111111262015
000101110011101101011011011111001010011000001001111001011000011010110101000001110000001110101010101011110111100010101000101100001111111111262015
011111001100110011111100101000111010101111010100100111010110111100011100011000011010101010011001011011100111010110101000011001001001110101101010100110111101010010011011101000110110010101101010100110110011101111262015
11101111010011101000011010011010100100111010000010011101110100100110100001011110011001000000111110011000010111100110000111010010011001101001101001010000011000111101001010101011101000011010011111010010010100110101100010010110110100100101101101010000101001010110001100001111100111111010000101011101011000110101011100010000010001101001101010010111101000001101001000111000110100100101011110010011011001010101010000001111010100000110000110100100010110000110010110010111100101100000111111111010010101001001111010100010010110000101110101010110110100100011011101011110010111101010100010010111011000100000111111111111101001111010010101011000100101011101001011111000100101111010010110100110100110110110010110010011010110111101111011111011110100101001101001010000101010000101010011010010100110000101111010100100100110011010000101100011011000111001011110100000000011110110011001010111010111100000111111111011110100101010010001010100010100001001111010011110101010110000111110101001010100000110001011100000111101000110010001100011000011110110001101010111100101111010000000001111011000111001101010010111000011111010000101011011100101100000111101010101101001000101100010010111010111010101001111011110010100110101010010010011101001000000111110101011010111101010011111011110101001001001011101011100100110110101110110010110000011111001111101010100000011110110011010011010100100111010011000001111101001000101010001010000100111101101001010011000101001001001101101010100101000000101001110100101100110100101100010100010110100101001101101100010110100100101000010010100101000010110010001100011000110111001001110100000100101100000111110100110010111100101101110010110000011110101110001010100110100101010011001010111010100001010011000001111010110000101010100001111111110111101001001100110100100110110001011010010011000110110000101100100100101110000111101100011101000010000111110011111101010111010010110010111100111101001100011011110111110111101001001010010101000011010011110011110010100110101110100010110101001101101001010011001101000010000111101100110011000010101111001011101010101101101001111262015
1111011100101011100111101100001111110101011010011011101001101011110010100110100111000011001000110100000000010111101111011011011001101101010111000001011110110110111101011100101101011100011010010111000011110101110010001100010110111010010110100110000010110110011000111111010111001000011011000110100101100111011010010110000001101010101110100001011110111011011001101100011100010111110011100110011011001010000101110110000011000011111101011100001110111010110011010110101100010111011001000101110001011100011010111011111001100101010111101111010101011000011010111111010110011001010111000101101000100101000101111000011100101100110010010101111111110101100001110010011110000110100010100001100011110101101010010101111101011000011010111111010101101110110001001100101011000001010110111111010101011001010111000001011101011100110011010101101001100000011010110110000001100101101111000001100011262015
011111011001011101010110110110001101111001101111000111010101000001100110110101111100110001100010011011110110001001101001011101100010100111262015
11010101001101101001110010101011010001111010101111262015

SampleOutput
Nov. 26th, 2015, Manehaton
Dear Applejack:
How is everything going?
Thank you for what you did last month!When I have arrived Helping Hooves Music Festival,I have forgotten who I really was.But then the old friend,dear you,remind me what real friendship is about,and told me that if I was true to myself,I couldn't go wrong!
In return,I have a very special surprise for you in next meeting at Dec. 25th 2015! That would be exciting!
Your Sincerely,
Rara


Submit
题目统计信息详细
总AC数31
通过人数22
尝试人数29
总提交量76
AC率28.95%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: