Runtime Error in Test Case

#include
#include
using namespace std;

void prime(int *p)
{
for(long long i=3;i<=50000000;i=i+2)
p[i]=1;

for(long long i=3;i<=50000000;i=i+2)
{
	if(p[i]==1)
	    for(long long j=i*i;j<=50000000;j=j+i)
		    p[j]=0;
}	

p[0]=p[1]=0;
p[2]=1;

}

int main() {
int x;
cin>>x;
int p[50000000]={0};
vector isprime;
prime§;

for(int i=2;i<=50000000;i++)
     if(p[i]==1)
	    isprime.push_back(i);

cout<<isprime[x-1];
return 0;

}

why it is giving runtime error for test case 0?

hey @Pramod123 since you have to tell 50000000th prime size of sieve array should be greater than that, make the seive array size 100000005 and try submitting it again.

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.