diff --git a/number/mll.cc b/number/mll.cc index 39c5b9c..c7dafea 100644 --- a/number/mll.cc +++ b/number/mll.cc @@ -6,6 +6,7 @@ template struct MLL { 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 * mod(inverse(rhs.val, mdl), mdl), mdl); } friend MLL operator%(const MLL& lhs, const MLL& rhs) { return mod(lhs.val - (lhs / rhs).val, mdl); } + friend MLL operator==(const MLL& lhs, const MLL& rhs) { return lhs.val == rhs.val; } void operator+=(const MLL& rhs) { val = (*this + rhs).val; } void operator-=(const MLL& rhs) { val = (*this - rhs).val; } void operator*=(const MLL& rhs) { val = (*this * rhs).val; } @@ -13,12 +14,3 @@ template struct MLL { void operator%=(const MLL& rhs) { val = (*this % rhs).val; } }; -template -ostream& operator<<(ostream& out, const MLL& num) { - return out << num.val; -} - -template -istream& operator>>(istream& in, MLL& num) { - return in >> num.val; -}