Update number/mll.cc
Signed-off-by: subcrip <contact@subc.rip>
This commit is contained in:
parent
8af9e8d96f
commit
48dbc55a09
|
@ -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); }
|
||||||
|
|
Loading…
Reference in New Issue