When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

TUDORTEA's blog

By TUDORTEA, history, 3 years ago, In English

Link of the problem is https://www.spoj.com/problems/PRIMES2 .

Which algorithm should be used to solve this problem? And how wheelSieve + segmentedSieve is implemented?

Thank you in advance.

  • Vote: I like it
  • -19
  • Vote: I do not like it

| Write comment?
»
3 years ago, # |
  Vote: I like it +11 Vote: I do not like it

see this and please try googling stuff(to know if it's solution already exists somewhere) before posting new blog.

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

    first of all, thank you. I tried codes from your link, but I got TLE. What should I do to avoid to TLE???