|
|
вернуться в форумmaybe the problem can be abstracted as the following one: n,m are integers, n given, find the smallest m such that [n/m]==[n/(m+1)] holds, where [] denotes the floor() function. well, anyone has any ideas? Yes, it's redefinition of problem. but how can i find such an m? a binary search does seems not to work... The binary search works. But it isn't a binary search by the answer. ;) I use binary search of answer in range Sqrt(n) and Sqrt(n) + Sqrt(Sqrt(n)) |
|
|