1
0
Fork 0

Update number/mll.cc

Signed-off-by: subcrip <contact@subc.rip>
This commit is contained in:
subcrip 2024-04-25 19:21:33 +08:00
parent 8af9e8d96f
commit 48dbc55a09
1 changed files with 1 additions and 0 deletions

View File

@ -1,6 +1,7 @@
template <ll mdl> struct MLL { template <ll mdl> struct MLL {
ll val; ll val;
MLL(ll v = 0) : val(mod(v, mdl)) {} MLL(ll v = 0) : val(mod(v, mdl)) {}
MLL(const MLL<mdl>& other) : val(other.val) {}
friend MLL operator+(const MLL& lhs, const MLL& rhs) { return mod(lhs.val + rhs.val, mdl); } friend MLL operator+(const MLL& lhs, const MLL& rhs) { return mod(lhs.val + rhs.val, mdl); }
friend MLL operator-(const MLL& lhs, const MLL& rhs) { return mod(lhs.val - rhs.val, mdl); } friend MLL operator-(const MLL& lhs, const MLL& rhs) { return mod(lhs.val - rhs.val, mdl); }
friend MLL operator*(const MLL& lhs, const MLL& rhs) { return mod(lhs.val * rhs.val, mdl); } friend MLL operator*(const MLL& lhs, const MLL& rhs) { return mod(lhs.val * rhs.val, mdl); }