|
|
back to boardSo faint! I feel thrte is a O(1) algo & AC, but I don't understand, can someone tell me why? After I get the function f(N)= N*N+a*N+(A-a-1), I solve f(a/2)=0 getting value of a, after that I find the two integar s1 s2 nearest to a and let f(s1) = 0 || f(s2) = 0 to min this function. An exception is a/2 > the N given by this problem, in this case it should be 0 |
|
|