diff options
author | Ta180m | 2020-05-02 21:27:19 -0500 |
---|---|---|
committer | Ta180m | 2020-05-02 21:27:19 -0500 |
commit | 797b463ad18778bee16b2a985419012be0d7164a (patch) | |
tree | 1434255951e6b416a094b5ce339dc5a04d61c818 /Math | |
parent | ded3d6aa874c0fe206e1f0876122b1c3b1e8feb8 (diff) |
Update primes.cpp
Diffstat (limited to 'Math')
-rw-r--r-- | Math/primes.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Math/primes.cpp b/Math/primes.cpp index e4ccf99..acbe0cf 100644 --- a/Math/primes.cpp +++ b/Math/primes.cpp @@ -4,8 +4,8 @@ vector<int> pr; void sieve() { bs.set(); bs[0] = bs[1] = 0; - for (ll i = 2; i < _sieve_size; ++i) if (bs[i]) { - for (ll j = i * i; j < _sieve_size; j += i) bs[j] = 0; + for (ll i = 2; i < sieve_size; ++i) if (bs[i]) { + for (ll j = i * i; j < sieve_size; j += i) bs[j] = 0; pr.push_back(i); } } |