it is not getting submitted … i mean no judgement is coming .
here is my code —
#include<bits/stdc++.h>
using namespace std;
// #define MAX 5000000
#define MAX 100000007
bool isPrime[MAX];
vectorans;
int sieveOfEratosthenes(int n){
isPrime[0]=false;
isPrime[1]=false;
// for(int i=0;i<=MAX;i++){
for(int i=2;i<MAX;i++){
isPrime[i]=true;
}
// for(int i=2;ii<=MAX;i++){
for(int i=2;ii<MAX;i++){
if(isPrime[i]){
// ans.push_back(i);
for(int j=i*i;j<MAX;j+=i){
isPrime[j]=false;
}
}
}
for(int i=2;i<MAX;i++){
if(isPrime[i]){
ans.push_back(i);
}
}
return ans[n-1];
}
int main(){
int t;
cin>>t;
while(t–){
int n;
cin>>n;
cout<<sieveOfEratosthenes(n)<<endl;
}
return 0;
}