1
0
Fork 0

Update include.hh

Signed-off-by: subcrip <contact@subc.rip>
This commit is contained in:
subcrip 2024-05-16 10:04:19 +08:00
parent 6e6d8fd24e
commit 2d83af3ae5
1 changed files with 5 additions and 5 deletions

View File

@ -385,11 +385,11 @@ struct MLLd {
ll val, mdl; ll val, mdl;
MLLd(ll mdl, ll v = 0) : mdl(mdl), val(mod(v, mdl)) {} MLLd(ll mdl, ll v = 0) : mdl(mdl), val(mod(v, mdl)) {}
MLLd(const MLLd& other) : val(other.val) {} MLLd(const MLLd& other) : val(other.val) {}
friend MLLd operator+(const MLLd& lhs, const MLLd& rhs) { return mod(lhs.val + rhs.val, mdl); } friend MLLd operator+(const MLLd& lhs, const MLLd& rhs) { return mod(lhs.val + rhs.val, lhs.mdl); }
friend MLLd operator-(const MLLd& lhs, const MLLd& rhs) { return mod(lhs.val - rhs.val, mdl); } friend MLLd operator-(const MLLd& lhs, const MLLd& rhs) { return mod(lhs.val - rhs.val, lhs.mdl); }
friend MLLd operator*(const MLLd& lhs, const MLLd& rhs) { return mod(lhs.val * rhs.val, mdl); } friend MLLd operator*(const MLLd& lhs, const MLLd& rhs) { return mod(lhs.val * rhs.val, lhs.mdl); }
friend MLLd operator/(const MLLd& lhs, const MLLd& rhs) { return mod(lhs.val * mod(inverse(rhs.val, mdl), mdl), mdl); } friend MLLd operator/(const MLLd& lhs, const MLLd& rhs) { return mod(lhs.val * mod(inverse(rhs.val, lhs.mdl), lhs.mdl), lhs.mdl); }
friend MLLd operator%(const MLLd& lhs, const MLLd& rhs) { return mod(lhs.val - (lhs / rhs).val, mdl); } friend MLLd operator%(const MLLd& lhs, const MLLd& rhs) { return mod(lhs.val - (lhs / rhs).val, lhs.mdl); }
friend bool operator==(const MLLd& lhs, const MLLd& rhs) { return lhs.val == rhs.val; } friend bool operator==(const MLLd& lhs, const MLLd& rhs) { return lhs.val == rhs.val; }
friend bool operator!=(const MLLd& lhs, const MLLd& rhs) { return lhs.val != rhs.val; } friend bool operator!=(const MLLd& lhs, const MLLd& rhs) { return lhs.val != rhs.val; }
void operator+=(const MLLd& rhs) { val = (*this + rhs).val; } void operator+=(const MLLd& rhs) { val = (*this + rhs).val; }