can you please look at my code where i have made a mistake in my code or i have to use any other method here other than sieves of erasothesus.
here is my code
#include
#include
#include
typedef long long int ll;
using namespace std;
int main(){
ll n;
cin>>n;
long long size=50000000;
ll a[size];
memset(a,0,sizeof(a));
a[0]=a[1]=1;
vector<ll> prime;
for(ll i=2;i*i<=size;i++){
if(a[i]==0){
for( ll j=2*i;j<size;j=j+i){
a[j]=1;
}}
}
for(ll i=0;i<size;i++){
if(a[i]==0)
prime.push_back(i);
}
cout<<prime[n-1];
return 0;
}