Welcome to Yumao′s Blog.
ZOJ Problem Set – 1006 Do the Untwist
, 2010年04月04日 , C Language , 评论 在〈ZOJ Problem Set – 1006 Do the Untwist〉中留言功能已關閉 ,
Do the Untwist

——————————————————————————–

Time Limit: 1 Second      Memory Limit: 32768 KB

——————————————————————————–

Cryptography deals with methods of secret communication that transform a message (the plaintext) into a disguised form (the ciphertext) so that no one seeing the ciphertext will be able to figure out the plaintext except the intended recipient. Transforming the plaintext to the ciphertext is encryption; transforming the ciphertext to the plaintext is decryption. Twisting is a simple encryption method that requires that the sender and recipient both agree on a secret key k, which is a positive integer.

The twisting method uses four arrays: plaintext and ciphertext are arrays of characters, and plaincode and ciphercode are arrays of integers. All arrays are of length n, where n is the length of the message to be encrypted. Arrays are origin zero, so the elements are numbered from 0 to n – 1. For this problem all messages will contain only lowercase letters, the period, and the underscore (representing a space).

(閱讀全文…)

关键字:, , , , , , ,
分页 (1): 1