Deepak and primes

#include
#include<bits/stdc++.h>
#define lli long long
using namespace std;
vectorprimes(100000001,true);
long long int arr[5000001];

int main() {
lli n;
cin>>n;
lli j=0,k=1;
lli i;

k=1;
//cout<<primes[7]<<"\n\n\n";
for(i=2;i<=100000000;i=i+1){

    if(primes[i]==true){
        arr[k]=i;

		j=2*i;
		if(k==n)
        {
            cout<<arr[k];
            break;
        }

		k++;


        while(j<100000000){

            //cout<<j<<" ";
            primes[j]=false;
            j=j+i;
        }

    }

}

}
i am getting run time error on submission plz correct my code

plz reply for my query

here we have to use sieve otherwise it will throw tle,
and what are you trying to do here.

vectorprimes(100000001,true);

see this code for better understanding

still i am getting TLE error

there is some problem in internal test cases only . I will report this to staff.

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.