rcpl

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

View the Project on GitHub ruthen71/rcpl

:warning: algebra/monoid_s/monoid_min_index.hpp

Required by

Code

#pragma once
// MS
template <class T, bool left = true> struct MonoidMinIndex {
    using S = std::pair<T, int>;
    static constexpr S op(S a, S b) {
        if (a.first < b.first) return a;
        if (a.first > b.first) return b;
        if (a.second > b.second) std::swap(a, b);
        return (left ? a : b);
    }
    static constexpr S e() { return {std::numeric_limits<T>::max(), -1}; }
};
#line 2 "algebra/monoid_s/monoid_min_index.hpp"
// MS
template <class T, bool left = true> struct MonoidMinIndex {
    using S = std::pair<T, int>;
    static constexpr S op(S a, S b) {
        if (a.first < b.first) return a;
        if (a.first > b.first) return b;
        if (a.second > b.second) std::swap(a, b);
        return (left ? a : b);
    }
    static constexpr S e() { return {std::numeric_limits<T>::max(), -1}; }
};
Back to top page