第24024题
以下C++实现的素数筛程序的时间复杂度为?
bool notPrime[N] = {false};
void sieve() {
    for (int n = 2; n * n < N; n++)
        if (!notPrime[n])
            for (int i = n * n; i < N; i += n)
                notPrime[i] = true;
}
A

O(N)

B

O(N×logN)

C

O(N×loglogN)

D

O(N²)