Editorial for DMOPC '14 Contest 4 P2 - Redirection


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.

By Eduard Ionescu

The solution involves using a simple Greedy Algorithm, where you find the index of the processing centre with the smallest value. Add the length of the encrypted string to its value and continue.

\mathcal{O}(N\cdot C)


Comments

There are no comments at the moment.