Deepak and primes problem

this code of deepak and primes problem of number theory is giving segmentation fault in coding blocks but working fine in other online compilers
please help

Hello @aman_81200 as the test cases are larger in this.
so here you have to apply the concept of segmented sieve.

5000000th prime number comes under 10^8 so we can so that with normal sieve I think
and also its working in other ides like c++ gdb compiler but not in coding blocks ide

@aman_81200 i have solved your doubt on the other doubt on which you have reopened.
Happy Learning!!
you can mark this as resolved.

@aman_81200 Sieve array requires you to store boolean data - true of false OR 1 or 0. Using int array would use up 8 times more space than required and that is a lot of wastage of space since we are making the sieve array of such a large size. Its possible some compiler won’t even allow you to make an array of so much space hence I suggested the modification.

okkkk now I got it
Thank you so for the support

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.