From 469333e1ca1762eab8923bf75dd3ea2654f26a1e Mon Sep 17 00:00:00 2001 From: subcrip Date: Thu, 28 Nov 2024 06:06:10 +0000 Subject: [PATCH] Update template.cc Signed-off-by: subcrip --- template.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/template.cc b/template.cc index 0cbf1af..a69f922 100644 --- a/template.cc +++ b/template.cc @@ -177,6 +177,10 @@ template ostream& operator<<(ostream& out, const pair istream& operator>>(istream& in, array& a) { + for (size_t i = 0; i < N; ++i) in >> a[i]; + return in; +} template void print_tuple_impl(std::basic_ostream& os, const Tuple& t, std::index_sequence) { using swallow = int[]; // guaranties left to right order @@ -376,11 +380,11 @@ template struct MLL { friend MLL operator%(const MLL& lhs, const MLL& rhs) { return mod(lhs.val - (lhs / rhs).val, mdl); } friend bool operator==(const MLL& lhs, const MLL& rhs) { return lhs.val == rhs.val; } friend bool operator!=(const MLL& lhs, const MLL& rhs) { return lhs.val != rhs.val; } - MLL& operator+=(const MLL& rhs) { return *this = *this + rhs; } - MLL& operator-=(const MLL& rhs) { return *this = *this - rhs; } - MLL& operator*=(const MLL& rhs) { return *this = *this * rhs; } - MLL& operator/=(const MLL& rhs) { return *this = *this / rhs; } - MLL& operator%=(const MLL& rhs) { return *this = *this % rhs; } + void operator+=(const MLL& rhs) { return *this = *this + rhs; } + void operator-=(const MLL& rhs) { return *this = *this - rhs; } + void operator*=(const MLL& rhs) { return *this = *this * rhs; } + void operator/=(const MLL& rhs) { return *this = *this / rhs; } + void operator%=(const MLL& rhs) { return *this = *this % rhs; } }; template