RangeAssignMaxTree

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

Structure supporting range assignment and range maximum operations.

Public Types

using ValueType = int

Public Functions

RangeAssignMaxTree(size_t size, ValueType initialValue)
void updateFromChildren(NodeType &parent, const NodeType &left, const NodeType &right)
void pushDown(size_t parent)
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

int rangeMaximum(size_t l, size_t r)

Calculate biggest value in the range [l, r)

Return

biggest value in given range

Parameters
  • l: inclusive left side of range

  • r: exclusive right side of range