library

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

View the Project on GitHub gyouzasushi/library

:heavy_check_mark: Acted Monoid: Range Assign Range Max
(algebra/range_assign_range_max.hpp)

概要

使い方

Verified with

Code

#pragma once
#include <limits>
#include <optional>
template <class T>
struct range_assign_range_max {
    using S = T;
    using F = std::optional<T>;
    static S op(S a, S b) {
        return a < b ? b : a;
    }
    static S e() {
        return std::numeric_limits<T>::lowest();
    }
    static S mapping(F f, S x) {
        return f ? *f : x;
    }
    static F composition(F f, F g) {
        return f ? f : g;
    }
    static F id() {
        return std::nullopt;
    }
    static constexpr bool composition_commutative = false;
};
#line 2 "algebra/range_assign_range_max.hpp"
#include <limits>
#include <optional>
template <class T>
struct range_assign_range_max {
    using S = T;
    using F = std::optional<T>;
    static S op(S a, S b) {
        return a < b ? b : a;
    }
    static S e() {
        return std::numeric_limits<T>::lowest();
    }
    static S mapping(F f, S x) {
        return f ? *f : x;
    }
    static F composition(F f, F g) {
        return f ? f : g;
    }
    static F id() {
        return std::nullopt;
    }
    static constexpr bool composition_commutative = false;
};
Back to top page