Squarefree Numbers
This problem is not very difficult. There is a very famous principle to consider the double counting issue. I reviewed my old code and found it was not well written and takes 2.1 second to get the answer. This time I rewrote it with the same idea, it only takes 0.76 second.
I also tried to solve it with the idea I learned in problem 184. My code is not as efficient as Robert's code. I will reuse it when necessary. It is a great tool for more difficult problems.
No comments:
Post a Comment