Editorial for ECOO '14 R2 P1 - Scratch and Win


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.

The mechanics of this question are simple – just make a counter for each type of prize and one for the blanks. Then it's all about anticipating all the possibilities. First of all, if any card is showing a win already, then that is the only possible win (no card can win twice). If there is no win showing, then there are different cases depending on the number of blanks. If the card has no blanks, it's a loser. If there is one blank, you are looking for doubles. If there are two blanks, then any symbol that is showing could be a winner. Finally, if there are three or more blanks, any prize is possible.


Comments

There are no comments at the moment.