Skip to content

Commit 05e0f70

Browse files
committed
Add power monoid for __gnu_cxx::__power
1 parent a4d6868 commit 05e0f70

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
template <int MOD = (int)1e9 + 7, typename T = long long> struct power_monoid {
2+
constexpr T operator()(const T &a, const T &b) const noexcept {
3+
return 1ll * a * b % MOD;
4+
}
5+
friend constexpr T identity_element(power_monoid<MOD, T>) noexcept {
6+
return 1;
7+
}
8+
};

0 commit comments

Comments
 (0)