| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 (추가 시간 없음) | 1024 MB | 53 | 50 | 34 | 94.444% |
In the fight against theft of intellectual property by rivalling universities, TU Delft has decided to implement a system of secure communication, to be called New Well-Encrypted Remote Communication. All internal communication will be encrypted before being sent over the network, and then decrypted upon arrival. They have already set up the infra-structure, they have come to you for the encryption.
You are tasked to design an algorithm for both encryption and decryption of text consisting of only English lowercase letters. You do not need to tell them how you do it, in fact, they encourage you to keep it a secret, to improve security. Your algorithm only needs to meet the following criteria:
The word "nwercjury" for example may not be encrypted as "irritating", because the number of letters does not match. Nor may you encrypt it as "imbecilic", since the fifth letter is a 'c' in both. An example of an acceptable encryption is "fantastic" (both have an 'n' and a 'c', but in different positions).
Your program will be run twice for each test case. In the first pass, your program will be given a number of strings to encrypt. In the second pass, your program will be given the strings as encrypted by the first pass, which it should then decrypt to retrieve the original input.
A testing tool is provided to help you develop your solution.
The input consists of:
encrypt" or "decrypt", indicating the action your program has to perform.a-z).For each string, output its encryption or decryption, as required.
encrypt 3 plaintext nwerc correct
encrypted delft balloon
decrypt 3 encrypted delft balloon
plaintext nwerc correct