Editorial for DMOPC '15 Contest 2 P1 - Grumpy Dwarf


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.

Author: FatalEagle

Despite the fact that it's only the first problem, a lot of people overthought it. The intended solution is simple simulation. Keep track of the number of metal bars as well as swords we've made. Once we run out of bars, output the number of swords we've made.

Time Complexity: \mathcal{O}(N)


Comments

There are no comments at the moment.