I am a newbie to competitive programming . Can you guys please debug my code for the problem PRIME1 and tell me what’s the issue ? It’s giving correct ans for the custom inputs and default test cases https://codeshare.io/mycode
@sagars21 You should really see the problem statement, it’s not asking about printing the number which has prime number of set-bits rather it’s asking for number of primes in the given range [L, R] with as constraint 1 \leq (R - L) \leq 10^{5}.
@lordninja_1997 You need to use an updated version of Sieve of Eratosthenes known as Segemented Sieve.
Refer to the links for understanding Segmented Sieve: