Editorial for GFSSOC '15 Fall S1 - T-Shirts


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.

We make the observation that every time we have a free T-shirt deal, we should redeem it for the most expensive T-shirt – that is, large if there are any, otherwise medium if there are any, otherwise small. An easy way to implement this is to put all T-shirts in sorted order inside a double-ended list and keep popping from both sides.


Comments

There are no comments at the moment.