Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add operator bool to modint
Signed-off-by: szdytom <[email protected]>
  • Loading branch information
szdytom committed Aug 14, 2023
commit 95a6273bb67a1440dffe06687d62b13e12937abd
2 changes: 2 additions & 0 deletions atcoder/modint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ struct static_modint : internal::static_modint_base {

mint operator+() const { return *this; }
mint operator-() const { return mint() - *this; }
operator bool() const { return _v == 0; }

mint pow(long long n) const {
assert(0 <= n);
Expand Down Expand Up @@ -206,6 +207,7 @@ template <int id> struct dynamic_modint : internal::modint_base {

mint operator+() const { return *this; }
mint operator-() const { return mint() - *this; }
operator bool() const { return _v == 0; }

mint pow(long long n) const {
assert(0 <= n);
Expand Down