We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e47b387 commit 4a74cb6Copy full SHA for 4a74cb6
atcoder/internal_math.hpp
@@ -83,7 +83,8 @@ constexpr bool is_prime_constexpr(int n) {
83
if (n % 2 == 0) return false;
84
long long d = n - 1;
85
while (d % 2 == 0) d /= 2;
86
- for (long long a : {2, 7, 61}) {
+ constexpr long long bases[3] = {2, 7, 61};
87
+ for (long long a : bases) {
88
long long t = d;
89
long long y = pow_mod_constexpr(a, t, n);
90
while (t != n - 1 && y != 1 && y != n - 1) {
0 commit comments