rcpl

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

View the Project on GitHub ruthen71/rcpl

:heavy_check_mark: algebra/acted_monoid/acted_monoid_min_assign.hpp

Depends on

Verified with

Code

#pragma once

#include "../monoid/monoid_assign.hpp"
#include "../monoid/monoid_min.hpp"

template <class T, T inf, T none> struct ActedMonoidMinAssign {
    using MS = MonoidMin<T, inf>;
    using MF = MonoidAssign<T, none>;
    using S = typename MS::value_type;
    using F = typename MF::value_type;
    static constexpr S mapping(const F f, const S x, const int size) {
        if (f == MF::identity()) {
            return x;
        }
        return f;
    }
};
#line 2 "algebra/acted_monoid/acted_monoid_min_assign.hpp"

#line 2 "algebra/monoid/monoid_assign.hpp"

template <class T, T none> struct MonoidAssign {
    using value_type = T;
    static constexpr T operation(const T& a, const T& b) noexcept {
        if (b == identity()) {
            return a;
        }
        return b;
    }
    static constexpr T identity() noexcept { return none; }
    static constexpr bool commutative = false;
};
#line 2 "algebra/monoid/monoid_min.hpp"

template <class T, T inf> struct MonoidMin {
    using value_type = T;
    static constexpr T operation(const T& a, const T& b) noexcept {
        return std::min(a, b);
    }
    static constexpr T identity() noexcept { return inf; }
    static constexpr bool commutative = true;
};
#line 5 "algebra/acted_monoid/acted_monoid_min_assign.hpp"

template <class T, T inf, T none> struct ActedMonoidMinAssign {
    using MS = MonoidMin<T, inf>;
    using MF = MonoidAssign<T, none>;
    using S = typename MS::value_type;
    using F = typename MF::value_type;
    static constexpr S mapping(const F f, const S x, const int size) {
        if (f == MF::identity()) {
            return x;
        }
        return f;
    }
};
Back to top page