Editorial for UTS Open '15 #1 - Caesar Salad
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.
Submitting an official solution before solving the problem yourself is a bannable offence.
Map the letter of the alphabet to the number
: A is mapped to
, B to
, etc. Then the value of the
bowl after
button presses is
. Simulate all values of
and take the minimum value which produces an acceptable result. Since
, it is never optimal to have
.
Complexity:
Comments