2022 G.W. Coding Contest 1 S3: Cipher:

You and your friend have some secret messages you want to keep secret, so you both came up with a secret language by changing individual characters of the English language.

However, to ensure things are secret, you both decide to change the language every day.

Given \(D\) days and \(N\) number of changes (number of changes does not change) each day on the same line, a list of each day's changes (changes do not carry over), and a message for each day, translate each message to the secret language.


TIME CONSTRAINT: 1s

Sample Input:

2 6
a b
b c
o n
, 4
e f
i $
hi, you are cool!
a b
b c
o n
y t
e f
i $
hi, you are cool!

Sample Output:

h$4 ynu brf cnnl!
h$, tnu brf cnnl!

Submit Solution

Problem author: Vincent