proconlib

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub KodamaD/proconlib

:heavy_check_mark: traits/pair_monoid.cpp

Required by

Verified with

Code

#pragma once
#include <utility>

template <class M, class N> struct PairMonoid {
    using Type = std::pair<typename M::Type, typename N::Type>;
    static constexpr Type identity() { return {M::identity(), N::identity()}; }
    static constexpr Type operation(const Type& l, const Type& r) {
        return {M::operation(l.first, r.first), N::operation(l.second, r.second)};
    }
};
#line 2 "traits/pair_monoid.cpp"
#include <utility>

template <class M, class N> struct PairMonoid {
    using Type = std::pair<typename M::Type, typename N::Type>;
    static constexpr Type identity() { return {M::identity(), N::identity()}; }
    static constexpr Type operation(const Type& l, const Type& r) {
        return {M::operation(l.first, r.first), N::operation(l.second, r.second)};
    }
};
Back to top page