RangeAssignMaxTree

class RangeAssignMaxTree : public LazySegmentTreeBase<int, uint8_t, RangeAssignMaxTree>

Structure supporting range assignment and range maximum operations.

Public Types

using ValueType = int

Public Functions

inline RangeAssignMaxTree(size_t size, ValueType initialValue)
inline void updateFromChildren(NodeType &parent, const NodeType &left, const NodeType &right)
inline void pushDown(size_t parent)
inline void setRange(size_t left, size_t right, NodeType value)

Change all the elements in range [left, right) to value.

Parameters:
  • left – inclusive range left side

  • right – exclusive right side of range

  • value – value to be assigned

inline int rangeMaximum(size_t l, size_t r)

Calculate biggest value in the range [l, r)

Parameters:
  • l – inclusive left side of range

  • r – exclusive right side of range

Returns:

biggest value in given range