competitive-programming-templates

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

View the Project on GitHub Misuki743/competitive-programming-templates

:heavy_check_mark: acted_monoid/add_min.cpp

Verified with

Code

template<class U>
struct add_min {
  using M = U;
  static M Mid() { return numeric_limits<T>::max(); }
  static M Mop(const M &a, const M &b) { return min(a, b); }
  using T = U;
  static T Tid() { return T(0); }
  static T Top(const T &a, const T &b) { return a + b; }
  static M act(const M &a, const T &b) { return a == Mid() ? Mid() : a + b; }
};
#line 1 "acted_monoid/add_min.cpp"
template<class U>
struct add_min {
  using M = U;
  static M Mid() { return numeric_limits<T>::max(); }
  static M Mop(const M &a, const M &b) { return min(a, b); }
  using T = U;
  static T Tid() { return T(0); }
  static T Top(const T &a, const T &b) { return a + b; }
  static M act(const M &a, const T &b) { return a == Mid() ? Mid() : a + b; }
};
Back to top page