Skip to content

Commit e747e5c

Browse files
committed
modint.
1 parent 92325aa commit e747e5c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/alfred/math/mod-int.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ class ModInt {
1313
public:
1414
using value_type = uint32_t;
1515
static constexpr value_type mod() noexcept { return M; }
16+
static constexpr ModInt sgn(int t) {
17+
return t & 1 ? M - 1 : 1;
18+
}
1619
value_type v;
1720
constexpr ModInt() noexcept : v(0) {}
1821
constexpr ModInt(int64_t x) noexcept : v(norm(x)) {}

0 commit comments

Comments
 (0)