Editorial for ECOO '13 R2 P1 - Upsetris


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.

If you try to actually simulate the "upset" process, you will get bogged down. All you really need to do is count the number of bricks in each column. To simulate the deletion of full rows, find the column with the smallest number of bricks and subtract this number from all columns. Then you have to remember to output the columns in the reverse order because the board is rotated 180 degrees.


Comments

There are no comments at the moment.