library

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

View the Project on GitHub maspypy/library

:heavy_check_mark: alg/monoid/summin.hpp

Required by

Verified with

Code

#pragma once

template <typename E>
struct Monoid_SumMin {
  using value_type = pair<E, E>;
  using X = value_type;
  static X op(X x, X y) { return {x.fi + y.fi, min(x.se, y.se)}; }
  static X from_element(E x) { return {x, x}; }
  static constexpr X unit() { return {E(0), infty<E>}; }
  static constexpr bool commute = true;
};
#line 2 "alg/monoid/summin.hpp"

template <typename E>
struct Monoid_SumMin {
  using value_type = pair<E, E>;
  using X = value_type;
  static X op(X x, X y) { return {x.fi + y.fi, min(x.se, y.se)}; }
  static X from_element(E x) { return {x, x}; }
  static constexpr X unit() { return {E(0), infty<E>}; }
  static constexpr bool commute = true;
};
Back to top page