Horje
sieve of eresthossis cp c++ Code Example
sieve of eresthossis cp c++
int n;
vector<char> is_prime(n+1, true);
is_prime[0] = is_prime[1] = false;
for (int i = 2; i <= n; i++) {
    if (is_prime[i] && (long long)i * i <= n) {
        for (int j = i * i; j <= n; j += i)
            is_prime[j] = false;
    }
}




Cpp

Related
c++ measure time in microseconds Code Example c++ measure time in microseconds Code Example
find last occurrence of character in string c++ Code Example find last occurrence of character in string c++ Code Example
access part of string in c++ Code Example access part of string in c++ Code Example
take pieces of a string in c++ Code Example take pieces of a string in c++ Code Example
Converting to string c++ Code Example Converting to string c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8