I’m getting WA for PRIME1 in C++. Everything seems right to me but there is probably an edge case I’ve missed. Anyone knows what’s the problem?
You should test it with the example data given in the problem.
Oh, sorry. That was the wrong code. This is the right one:
I’ve tested your code with some random ranges, but I haven’t been able to find any differences from the answers given by my AC code.
So apparently it was an off by one error. The limits of the segmented sieve were set wrong so they skipped a number when m - n > 32000. Anyway, got AC now
Ah good catch. I couldn’t try any big ranges as the amount of output is limited on ideone.
Please could you edit your posts to remove the code? Stop people copying and submitting it.