Best Approximations
This problem is quite hard. My old code needs minutes to get the answer since I used my poor bigInteger class to find the best approximation. But if one asks google with appropriate key words, one can find some very useful web pages.
With the help of wikipedia, I find a better method. This method is quite fast, but for some situations, I still can not handle with only 64bit integers. I went back to my bigInteger class again to handle such situations and found the correct answer.
It takes 0.6 second.
nice job!!! but how could you do that??? My old code run for nearly 10 mins.
ReplyDeleteCan I see your???