Skip to content

Commit b12e1cb

Browse files
committed
Fixed a bug in speed-of-light-power calculation
1 parent 9b1a5c3 commit b12e1cb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/alfred/math/speed-of-light-power.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class SOLPower { // Speed Of Light Power. O(sqrt(n)) ~ O(1)
2727
}
2828
}
2929
inline mint power(long long index) {
30-
if (P && index >= mod) index %= mod;
30+
if (P && index >= mod) index %= mod - 1;
3131
return ps[index / sq] * p1[index % sq];
3232
}
3333
};

0 commit comments

Comments
 (0)