competitive-programming-library

This documentation is automatically generated by online-judge-verify-helper

View the Project on GitHub kmyk/competitive-programming-library

:warning: monoids/max_index.hpp

Back to top page

Code

#pragma once
#include <algorithm>
#include <climits>
#include <limits>
#include <utility>

/**
 * @note a semilattice
 */
template <class T>
struct max_index_monoid {
    typedef std::pair<T, int> value_type;
    value_type unit() const { return std::make_pair(std::numeric_limits<T>::lowest(), INT_MIN); }
    value_type mult(value_type a, value_type b) const { return std::max(a, b); }
};

#line 2 "monoids/max_index.hpp"
#include <algorithm>
#include <climits>
#include <limits>
#include <utility>

/**
 * @note a semilattice
 */
template <class T>
struct max_index_monoid {
    typedef std::pair<T, int> value_type;
    value_type unit() const { return std::make_pair(std::numeric_limits<T>::lowest(), INT_MIN); }
    value_type mult(value_type a, value_type b) const { return std::max(a, b); }
};

Back to top page