Editorial for Olympic Scoring
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.
Author:
It is always optimal for Canada to win gold and only gold medals as they increase Canada's score by the most points. Consider the difference between Canada's score and , and calculate the number of gold medals needed to win. Note that this number may be .
Time Complexity:
Comments
So the formula is ans=(ceil((N-S)/5))? And by the way, in the Constraints : , isn't a lot? How can a time limit of 0,5s work using large numbers!
is not really alot, it fits within a 64-bit signed integer
moving a couple of these bits around is nothing for a cpu with billions of transistors