Editorial for TLE '15 P3 - Poetry


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.

A straightforward implementation and string manipulation algorithm. The only important thing to note is that splitting long strings into two parts will time out. In other words, if a long string needs to be split, do not make the string equal to its second half. Instead, leave it as is and use a variable to keep track of the position in the string. The modulus operation can be used to make cycles easier to handle.

Time complexity: \mathcal{O}(N)


Comments

There are no comments at the moment.