Editorial for WC '17 Contest 3 J2 - Certified Fresh
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.
We can process the reviews one by one, while maintaining three pieces of information – the number of positive reviews so far, the total number of reviews so far, and the maximum Tomatometer score achieved so far (all initialized to ).
When processing a review, we can update the positive/total review counts, compute the current Tomatometer score, and update the maximum Tomatometer score if it's now been surpassed. After processing all reviews, we can output the maximum Tomatometer score achieved.
Comments