Help me out with this problem--PRIME1 -- >prime generator -->run time error(SIGSEGV)

I am getting TLE , I have used segmented sieve.

here is the problem–>

here is my solution–>

You are getting a runtime error(SIGSEGV) not a TLE.

plz explain the diff between the two.
And how to get rid of runtime error

TLE simply means Time Limit Exceeded. This happens because your algorithm took too long to run thus you need to find a way to optimize it.

This link should help you understand (SIGSEGV)


Your algorithm could be assessing memory it shouldn’t or it is probably using too much memory. I am finding it a bit difficult to understand some parts of your code though. Check this link out is you haven’t done that already:

1 Like