帮忙翻译一篇英文啊~~北京大学ACM1617 题,不要直接工具翻译的,那个我也会. 英语大神来,追加50分以上 Crypto ColumnsTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 2122 Accepted: 1307 DescriptionThe columnar

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/05 05:14:53
帮忙翻译一篇英文啊~~北京大学ACM1617 题,不要直接工具翻译的,那个我也会. 英语大神来,追加50分以上 Crypto ColumnsTime Limit: 1000MS  Memory Limit: 10000K Total Submissions: 2122  Accepted: 1307 DescriptionThe columnar

帮忙翻译一篇英文啊~~北京大学ACM1617 题,不要直接工具翻译的,那个我也会. 英语大神来,追加50分以上 Crypto ColumnsTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 2122 Accepted: 1307 DescriptionThe columnar
帮忙翻译一篇英文啊~~北京大学ACM1617 题,不要直接工具翻译的,那个我也会. 英语大神来,追加50分以上
Crypto Columns
Time Limit: 1000MS Memory Limit: 10000K
Total Submissions: 2122 Accepted: 1307
Description
The columnar encryption scheme scrambles the letters in a message (or plaintext) using a keyword as illustrated in the following example: Suppose BATBOY is the keyword and our message is MEET ME BY THE OLD OAK TREE. Since the keyword has 6 letters, we write the message (ignoring spacing and punctuation) in a grid with 6 columns, padding with random extra letters as needed:
MEETME
BYTHEO
LDOAKT
REENTH
Here, we've padded the message with NTH. Now the message is printed out by columns, but the columns are printed in the order determined by the letters in the keyword. Since A is the letter of the keyword that comes first in the alphabet, column 2 is printed first. The next letter, B, occurs twice. In the case of a tie like this we print the columns leftmost first, so we print column 1, then column 4. This continues, printing the remaining columns in order 5, 3 and finally 6. So, the order the columns of the grid are printed would be 2, 1, 4, 5, 3, 6, in this case. This output is called the ciphertext, which in this example would be EYDEMBLRTHANMEKTETOEEOTH. Your job will be to recover the plaintext when given the keyword and the ciphertext.
Input
There will be multiple input sets. Each set will be 2 input lines. The first input line will hold the keyword, which will be no longer than 10 characters and will consist of all uppercase letters. The second line will be the ciphertext, which will be no longer than 100 characters and will consist of all uppercase letters. The keyword THEEND indicates end of input, in which case there will be no ciphertext to follow.
Output
For each input set, output one line that contains the plaintext (with any characters that were added for padding). This line should contain no spacing and should be all uppercase letters.

帮忙翻译一篇英文啊~~北京大学ACM1617 题,不要直接工具翻译的,那个我也会. 英语大神来,追加50分以上 Crypto ColumnsTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 2122 Accepted: 1307 DescriptionThe columnar
描述:
在邮件(或明文)中使用圆柱状加密方案,正如下面的例子:假设BATBOY是关键字,而且我们的信息是MEET ME BY THE OLD OAK TREE(我身边老橡树上).由于关键字有6个字母,我们将此信息写成6个字母一格(忽略间距和标点符号),再根据需要随机填充其他字母.
MEETME
BYTHEO
LDOAKT
REENTH
这里我们填充的字母是NTH,现在这个信息要按列打印出来,但列要按字母在关键字中的顺序打印.由于A在字母表中出现在第一个,先将第二列打印出来,第二个是B,出现了两次,在这样的情况下先打印最左边的,所以先打印第一列,再打印第四列.以此类推,按列的打印顺序是2 1 4 5 3 6 .在这种情况下,输出文本就称为密文.此处有一个列子:
EYDEMBLRTHANMEKTETOEEOTH.你的任务就是恢复所给的明文和密文的关键字.