kyopro-lib

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

View on GitHub

:heavy_check_mark: Range add / Range min with count
(Mylib/AlgebraicStructure/MonoidAction/add_min_with_count.cpp)

Operations

Requirements

Notes

Problems

References

Verified with

Code

#pragma once

namespace haar_lib {
  template <typename MonoidUpdate, typename MonoidGet>
  struct add_min_with_count {
    using monoid_get        = MonoidGet;
    using monoid_update     = MonoidUpdate;
    using value_type_get    = typename MonoidGet::value_type;
    using value_type_update = typename MonoidUpdate::value_type;

    value_type_get operator()(const value_type_get &a, const value_type_update &b, int) const {
      return {a.value ? a.value.value() + b : a.value, a.count};
    }
  };
}  // namespace haar_lib
#line 2 "Mylib/AlgebraicStructure/MonoidAction/add_min_with_count.cpp"

namespace haar_lib {
  template <typename MonoidUpdate, typename MonoidGet>
  struct add_min_with_count {
    using monoid_get        = MonoidGet;
    using monoid_update     = MonoidUpdate;
    using value_type_get    = typename MonoidGet::value_type;
    using value_type_update = typename MonoidUpdate::value_type;

    value_type_get operator()(const value_type_get &a, const value_type_update &b, int) const {
      return {a.value ? a.value.value() + b : a.value, a.count};
    }
  };
}  // namespace haar_lib
Back to top page