diff --git a/include.hh b/include.hh index cd29fd8..2e23ee5 100644 --- a/include.hh +++ b/include.hh @@ -385,11 +385,11 @@ struct MLLd { ll val, mdl; MLLd(ll mdl, ll v = 0) : mdl(mdl), val(mod(v, mdl)) {} 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, 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 * mod(inverse(rhs.val, mdl), mdl), 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 + rhs.val, lhs.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, lhs.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, 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; } void operator+=(const MLLd& rhs) { val = (*this + rhs).val; }