This documentation is automatically generated by online-judge-tools/verification-helper
View the Project on GitHub kmyk/competitive-programming-library
#include "monoids/min_count.hpp"
#pragma once #include <limits> #include <utility> template <class T> struct min_count_monoid { typedef std::pair<T, int> value_type; value_type unit() const { return std::make_pair(std::numeric_limits<T>::max(), 0); } value_type mult(value_type a, value_type b) const { if (a.first < b.first) return a; if (a.first > b.first) return b; return std::make_pair(a.first, a.second + b.second); } static value_type make(T a) { return std::make_pair(a, 1); } };
#line 2 "monoids/min_count.hpp" #include <limits> #include <utility> template <class T> struct min_count_monoid { typedef std::pair<T, int> value_type; value_type unit() const { return std::make_pair(std::numeric_limits<T>::max(), 0); } value_type mult(value_type a, value_type b) const { if (a.first < b.first) return a; if (a.first > b.first) return b; return std::make_pair(a.first, a.second + b.second); } static value_type make(T a) { return std::make_pair(a, 1); } };