Editorial for Valentine's Day '18 J1 - The Cactus Number


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.

Author: kipply

To solve this problem, one should keep the maximum value of cuteness while taking input.

for i in range(n)
    if k > highest: highest = k

The rest of the problem comes down to an if, else if and else statement. Be sure to compare to the Carol numbers multiplied by 1000.

if max > 10000
    ans = "Something is wrong with these cuteness values"
else if max > 1000
    ans = "Cuteness by definition is similarity to Cactus"
else
    ans = "Cuteness by definition is similarity to Carol"

Comments

There are no comments at the moment.