Editorial for COCI '07 Contest 3 #3 Tajna
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
We calculate and from the length of the message.
One way to reconstruct the message is to construct the matrix and write the encrypted message in column-major order, and then read it in row-major order (because this is the opposite of what Mirko does to encrypt the message).
Another way is to see that what we really output are, in order, characters at indices .
Comments