CP-Library

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

View the Project on GitHub joji0/CP-Library

:warning: acted-monoid/MinAdd.hpp

Code

#pragma once
#include <algorithm>
#include <cstdint>
#include <limits>

template <typename T = int64_t>
struct MinAdd {
        using S = T;
        using F = T;
        static S op(S a, S b) { return std::min(a, b); }
        static S e() { return std::numeric_limits<T>::max(); }
        static S mapping(F f, S x) { return x + f; }
        static F composition(F f, F g) { return f + g; }
        static F id() { return 0; }
};
#line 2 "acted-monoid/MinAdd.hpp"
#include <algorithm>
#include <cstdint>
#include <limits>

template <typename T = int64_t>
struct MinAdd {
        using S = T;
        using F = T;
        static S op(S a, S b) { return std::min(a, b); }
        static S e() { return std::numeric_limits<T>::max(); }
        static S mapping(F f, S x) { return x + f; }
        static F composition(F f, F g) { return f + g; }
        static F id() { return 0; }
};
Back to top page