diff --git a/template.cc b/template.cc index b775ab1..a85a615 100644 --- a/template.cc +++ b/template.cc @@ -148,8 +148,6 @@ struct array_hash { #define faster(um) __AS_PROCEDURE((um).reserve(1024); (um).max_load_factor(0.25);) #define unordered_counter(from, to) __AS_PROCEDURE(unordered_map<__as_typeof(from), size_t, safe_hash> to; for (auto&& x : from) ++to[x];) #define counter(from, to, cmp) __AS_PROCEDURE(map<__as_typeof(from), size_t, cmp> to; for (auto&& x : from) ++to[x];) -#define pa(a) __AS_PROCEDURE(__typeof(a) pa; pa.push_back({}); for (auto&&x : a) pa.push_back(pa.back() + x);) -#define sa(a) __AS_PROCEDURE(__typeof(a) sa(a.size() + 1); {int n = a.size(); for (int i = n - 1; i >= 0; --i) sa[i] = sa[i + 1] + a[i];};) #define adj(ch, n) __AS_PROCEDURE(vector> ch((n) + 1);) #define edge(ch, u, v) __AS_PROCEDURE(ch[u].push_back(v), ch[v].push_back(u);) #define edgew(ch, u, v, ...) __AS_PROCEDURE(ch[u].emplace_back(v, __VA_ARGS__), ch[v].emplace_back(u, __VA_ARGS__);) @@ -378,11 +376,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; } - 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; } - void operator/=(const MLL& rhs) { val = (*this / rhs).val; } - void operator%=(const MLL& rhs) { val = (*this % rhs).val; } + 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