please tell where my code is incorrect as one test case is not getting passed
the code is as follows:-
#include
using namespace std;
int main() {
long long int n1;
cin>>n1;
long long int n=50000000;
long long int primes[n]={0};
// marking odd numbers as prime
for(long long int i=3;i<=n;i+=2){
primes[i]=1;
}
// taking odd numbers and marking their multiples as not prime
for(long long int i=3;i<=n;i+=2){
for(long long int j=i*i;j<=n;j+=i){
primes[j]=0;
}
}
// case when n=2,1,0
primes[0]=primes[1]=0;
primes[2]=1;
// getting n1th prime no from the sieve
long long int count=0;
for(int i=0;i<=n;i++){
if(primes[i]==1){
count++;
}
if(count==n1){
cout<<i;
break;
}
}
return 0;
}