lotus.eater086's blog

By lotus.eater086, history, 6 months ago, In English,

Problem Link : https://www.spoj.com/problems/PRIMES2/ My Tle Solution : https://pastebin.com/wXtp0wVf In this problem you have to generate primes upto 10^9 . Time limit: 2.281s

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

»
6 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by lotus.eater086 (previous revision, new revision, compare).

»
6 months ago, # |
Rev. 2   Vote: I like it +4 Vote: I do not like it

i thought that sieve algorithm is the best algorithm to generate prime numbers and if n is 1e9 we use segmented sieve but sieve and segmented sieve have the same time complexity so i start searching for something else "thanks to you :p " i find an old post on codeforces that it may help you :D