By UBERMENSCH., history, 3 years 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

3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

3 years 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