const int N = 1e5 + 10;
int primes[N], cnt;
bool st[N];
void get_primes(int n) {
for(int i = 2; i <= n; i++) {
if(!st[i]) primes[++cnt] = i;
for(int j = 1; primes[j] <= n / i; j ++) {
st[primes[j] * i] = true;
if(i % primes[j] == 0) break;
}
}
}
标签:10,cnt,int,素数,线性,primes From: https://www.cnblogs.com/msluli/p/16757540.html