Skip to content

Commit c21e533

Browse files
committed
large sqrt threshold
1 parent cec13b1 commit c21e533

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cp-algo/math/sieve.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ namespace cp_algo::math {
7575
return (x / coprime) * period + res210[x % coprime];
7676
}
7777

78-
constexpr size_t sqrt_threshold = 1 << 15;
78+
constexpr size_t sqrt_threshold = 1 << 16;
7979
constexpr auto sqrt_prime_bits = []() {
8080
const int size = sqrt_threshold / 4;
8181
bit_array<size> prime;
@@ -152,7 +152,7 @@ namespace cp_algo::math {
152152
template <class BitArray>
153153
constexpr void sieve210(BitArray& prime, uint32_t l, uint32_t r, size_t i, int state) {
154154
static const auto ord_step = []() {
155-
std::array<std::array<uint32_t, 2 * coprime>, num_primes> ord_steps;
155+
big_vector<std::array<uint32_t, 2 * coprime>> ord_steps(num_primes);
156156
for (uint32_t i = 0; i < size(sqrt_primes); i++) {
157157
auto p = sqrt_primes[i];
158158
auto &ords = ord_steps[i];

0 commit comments

Comments
 (0)