Skip to content

Commit 4a74cb6

Browse files
committed
fix #3: fix is_prime for msvc
1 parent e47b387 commit 4a74cb6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

atcoder/internal_math.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ constexpr bool is_prime_constexpr(int n) {
8383
if (n % 2 == 0) return false;
8484
long long d = n - 1;
8585
while (d % 2 == 0) d /= 2;
86-
for (long long a : {2, 7, 61}) {
86+
constexpr long long bases[3] = {2, 7, 61};
87+
for (long long a : bases) {
8788
long long t = d;
8889
long long y = pow_mod_constexpr(a, t, n);
8990
while (t != n - 1 && y != 1 && y != n - 1) {

0 commit comments

Comments
 (0)