|
|
back to boardCommon Board71222119 mailto : trungduck@yahoo.com Yes there is much simpler algorithm for this problem, just use array [1..10000] and do binary search on it. Use the elements of the array to denote how many times you have gone left of them(during the binary search). You should do this sequentialy for every element in the input, and you'll get n * log 10000 algorithm. |
|
|