{"problem":{"name":"049. Decryption","description":{"content":"A monoalphabetic cipher is a type of encryption where each letter in the alphabet correlates to another letter in the alphabet. For this question you need to decrypt a piece of text given the key used","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10269049"},"statements":[{"statement_type":"Markdown","content":"A monoalphabetic cipher is a type of encryption where each letter in the alphabet correlates to another letter in the alphabet. For this question you need to decrypt a piece of text given the key used to encrypt it and the encrypted message.\n\nThe first line will be the key needed to decrypted the text and the second line will be the encrypted message. For the key that is given, the first letter of the key correlates to A, the second letter in the the key goes to B, then C and so on.\n\nPrint the following: \"Decrypted text: (Decrypted text)\"\n\n## Input\n\nThe first line will be the key needed to decrypted the text and the second line will be the encrypted message. For the key that is given, the first letter of the key correlates to A, the second letter in the the key goes to B, then C and so on.\n\n## Output\n\nPrint the following: \"Decrypted text: (Decrypted text)\"\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ K = (k_1, k_2, \\dots, k_{26}) $ be the encryption key, where $ k_i \\in \\{A, B, \\dots, Z\\} $ and $ k_i $ is the ciphertext letter corresponding to plaintext letter $ (i-1) $-th letter of the alphabet (i.e., $ k_1 $ maps to 'A', $ k_2 $ to 'B', ..., $ k_{26} $ to 'Z').  \nLet $ C = c_1 c_2 \\dots c_n $ be the encrypted message, where each $ c_j \\in \\{A, B, \\dots, Z\\} $.  \n\n**Constraints**  \n1. $ K $ is a permutation of the 26 uppercase English letters.  \n2. $ C $ consists only of uppercase English letters.  \n\n**Objective**  \nCompute the decrypted message $ P = p_1 p_2 \\dots p_n $, where for each $ c_j \\in C $:  \n$$\np_j = \\text{the } (i)\\text{-th letter of the alphabet}, \\quad \\text{such that } k_i = c_j\n$$  \nThat is, $ p_j = \\text{chr}(\\text{ord}('A') + \\text{index of } c_j \\text{ in } K) $.  \n\n**Output**  \n\"Decrypted text: $ P $\"","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10269049","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}