This documentation is automatically generated by online-judge-tools/verification-helper
View the Project on GitHub Misuki743/competitive-programming-templates
template<class U>
struct add_sum {
using M = pair<U, int>;
static M Mid() { return make_pair(U(0), 0); }
static M Mop(const M &a, const M &b) { return make_pair(a.first + b.first, a.second + b.second); }
using T = U;
static T Tid() { return T(0); }
static T Top(const T &a, const T &b) { return a + b; }
static M act(const M &a, const T &b) { return make_pair(a.first + a.second * b, a.second); }
};#line 1 "acted_monoid/add_sum.cpp"
template<class U>
struct add_sum {
using M = pair<U, int>;
static M Mid() { return make_pair(U(0), 0); }
static M Mop(const M &a, const M &b) { return make_pair(a.first + b.first, a.second + b.second); }
using T = U;
static T Tid() { return T(0); }
static T Top(const T &a, const T &b) { return a + b; }
static M act(const M &a, const T &b) { return make_pair(a.first + a.second * b, a.second); }
};