https://www.codechef.com/viewsolution/23258358
im getting tle for this question....any suggestion to overcome ..???????
Asked by: Nitesh_Kumar on April 7, 2019, 6:34 p.m. Last updated on April 7, 2019, 6:34 p.m.
You are computing the prime factors of the number ,say N, in range [a,b] in O(N^1/2) compexity which is resulting in TLE. You have to derive some pre-processed table using which which you can compute this in constant time. This can be achieved using Sieve of Eratosthenes for which you can refer here .