I can’t make a program that doesn’t run out of time or memory for finding prime numbers in interval. I used segmented sieve, got 2gb of memory usage. Checking prime from 1 to sqrt(n) still prints TLE. I really dont know what to do…

  • created

    Aug '23
  • last reply

    Aug '23
  • 1

    reply

  • 334

    views

  • 2

    users

Check primes in the interval only. Use something like miller-rabin, or trial division perhaps. I’ve tried these, and still haven’t got AC though.