Problem Description
Problem Analysis
I feel the hard part of this problem is… it’s an English-language problem
-.-
And then there’s the fact that I can’t understand what the problem is asking
Actually, the solution to this problem is very simple
It is just to find the integer value of T that makes this quadratic equation reach its extremum
…uh
Or rather
find an integer T such that when it is chosen as the value, the function result is maximized
(because N>0)
The equation should actually be written like this
which is equivalent to
Replacing it with x might make it easier to understand…
So…
It’s very simple
There is also something to note: here we need the integer value of T
So we need to check whether the result obtained from the formula is an integer
If it is not
we also need to compare the function values of the two integers on its left and right
(Also, when N==0, the output should be 0)
| |
Problem URL: Light [1275] Internet Service Providers