I am looking for sieve implementation for limit 10^8

Revision en1, by Sukarna_Paul, 2019-02-23 23:39:38

I have been trying to solve this problem for last few days . Here is the Problem link SPOJ PTRI .

I have used Linear sieve , but the limit is so high that it is getting TLE in O(N) . I have tried it with sieve of aktin also. But still got TLE . Please help me to solve this one.

I found this problem in -Morass- blog Link . You can visit it , I am confident that you will find it useful.

Tags #primes, #sieve

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Sukarna_Paul 2019-02-23 23:39:38 571 Initial revision (published)