pub struct LazySegmentTree<M: ExtMonoid> {
    pub size: usize,
    /* private fields */
}
Expand description

遅延評価セグメント木

Fields§

§size: usize

Implementations§

source§

impl<M: ExtMonoid> LazySegmentTree<M>

source

pub fn new(n: usize) -> Self

遅延評価セグメント木を初期化する

  • n: 配列サイズ
source

pub fn apply<R: RangeBounds<usize> + Debug>(&mut self, range: R, val: M::F)

区間にvalを作用させる

  • range: [left, right)
source

pub fn get<R: RangeBounds<usize> + Debug>(&mut self, range: R) -> M::X

区間を取得する

  • range: [left, right)

Trait Implementations§

source§

impl<M: Debug + ExtMonoid> Debug for LazySegmentTree<M>where M::X: Debug, M::F: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<M: ExtMonoid> From<&Vec<<M as ExtMonoid>::X, Global>> for LazySegmentTree<M>

source§

fn from(src: &Vec<M::X>) -> Self

Converts to this type from the input type.
source§

impl<M> ShowBinaryTree<(usize, usize, usize)> for LazySegmentTree<M>where M: ExtMonoid, M::F: Debug, M::X: Debug,

source§

fn get_root(&mut self) -> (usize, usize, usize)

<required> 根を取得する
source§

fn get_left( &mut self, (l, r, w): &(usize, usize, usize) ) -> Option<(usize, usize, usize)>

<required> 左の子のポインタを取得する
source§

fn get_right( &mut self, (l, r, w): &(usize, usize, usize) ) -> Option<(usize, usize, usize)>

<required> 右の子のポインタを取得する
source§

fn print_node(&mut self, (l, r, _): &(usize, usize, usize)) -> String

<required> ノードの値を表示する
source§

fn print_inner( &mut self, ptr: P, fill: &mut Vec<&'static str>, last: &'static str )

再帰的にprintを行う
source§

fn print_as_binary_tree(&mut self)

2分木としてフォーマットする

Auto Trait Implementations§

§

impl<M> RefUnwindSafe for LazySegmentTree<M>where <M as ExtMonoid>::F: RefUnwindSafe, <M as ExtMonoid>::X: RefUnwindSafe,

§

impl<M> Send for LazySegmentTree<M>where <M as ExtMonoid>::F: Send, <M as ExtMonoid>::X: Send,

§

impl<M> Sync for LazySegmentTree<M>where <M as ExtMonoid>::F: Sync, <M as ExtMonoid>::X: Sync,

§

impl<M> Unpin for LazySegmentTree<M>where <M as ExtMonoid>::F: Unpin, <M as ExtMonoid>::X: Unpin,

§

impl<M> UnwindSafe for LazySegmentTree<M>where <M as ExtMonoid>::F: UnwindSafe, <M as ExtMonoid>::X: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V