Official
Furthermore, suppose we add reviews with stars.
In this case, the condition for the average rating to be at least stars can be formulated as follows:
From here, proceed with transforming the equation.
From this equation, we can see that adding reviews with stars or less is meaningless or harmful.
Continuing with the transformation by setting , we get .
Let’s consider satisfying this equation with the minimum bribe.
In other words, these two actions can be exchanged.
Using this exchange, we can see that (for any additional costs ) there are not so many optimal candidates for .
Furthermore, by calculating the necessary costs for several patterns and taking the of them, we can solve this problem.
B - Bought Review Editorial by evima
HintsHint 0
If you want the average rating to be at least stars, adding reviews with or stars would be a waste.Hint 1
What does it mean for the average rating to be at least stars? Let’s formulate it. (This formulation can explain Hint 0)Hint 2
Suppose there were originally reviews with a total of stars.Furthermore, suppose we add reviews with stars.
In this case, the condition for the average rating to be at least stars can be formulated as follows:
From here, proceed with transforming the equation.
Hint 3
By transforming the equation, we obtain the following:From this equation, we can see that adding reviews with stars or less is meaningless or harmful.
Continuing with the transformation by setting , we get .
Let’s consider satisfying this equation with the minimum bribe.
Hint 4
Regarding the equation in Hint 3, it can be seen that “adding two -star reviews” has the same effect as “adding one -star review”.Hint 5
“Adding two 4-star reviews” has the same effect as “adding one 5-star review.”In other words, these two actions can be exchanged.
Using this exchange, we can see that (for any additional costs ) there are not so many optimal candidates for .
Furthermore, by calculating the necessary costs for several patterns and taking the of them, we can solve this problem.
posted:
last update: