Project Euler 007
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1e7 + 10;
int tot;
int ntp[N];
int primes[N];
void sieve () {
ntp[1] = 1;
for(int i = 2;i < N; i ++) {
if(!ntp[i]) {
primes[++tot] = i;
}
for(int j = 1;j <= tot and i * primes[j] < N; j ++) {
ntp[i * primes[j]] = 1;
if(i % primes[j] == 0) break;
}
}
}
signed main () {
sieve();
cout << primes[10001] << endl;
return 0;
}