This documentation is automatically generated by online-judge-tools/verification-helper
View the Project on GitHub ruthen71/rcpl
#include "algebra/monoid_s_f/monoid_sum_size_add.hpp"
#pragma once #include "algebra/monoid_s/monoid_sum_size.hpp" #include "algebra/monoid_f/monoid_add.hpp" // MSF template <class T> struct MonoidSumSizeAdd { using MS = MonoidSumSize<T>; using MF = MonoidAdd<T>; using S = typename MS::S; using F = typename MF::F; static constexpr S mapping(F f, S x) { return {x.first + f * x.second, x.second}; } };
#line 2 "algebra/monoid_s/monoid_sum_size.hpp" // MS template <class T> struct MonoidSumSize { using S = std::pair<T, int>; static constexpr S op(S a, S b) { return {a.first + b.first, a.second + b.second}; } static constexpr S e() { return {T(0), 0}; } }; #line 2 "algebra/monoid_f/monoid_add.hpp" // MF template <class T> struct MonoidAdd { using F = T; static constexpr F composition(F f, F g) { return f + g; } static constexpr F id() { return T(0); } }; #line 4 "algebra/monoid_s_f/monoid_sum_size_add.hpp" // MSF template <class T> struct MonoidSumSizeAdd { using MS = MonoidSumSize<T>; using MF = MonoidAdd<T>; using S = typename MS::S; using F = typename MF::F; static constexpr S mapping(F f, S x) { return {x.first + f * x.second, x.second}; } };