pub struct LazySegtree<A: Action> { /* private fields */ }
Expand description
モノイド列の区間更新・区間取得($O(\log n)$, $O(\log n)$)ができる。
Implementations§
Source§impl<A: Action> LazySegtree<A>
impl<A: Action> LazySegtree<A>
Sourcepub fn new(n: usize) -> Self
pub fn new(n: usize) -> Self
長さn
のLazySegtree
を生成する。
Sourcepub fn fold(&mut self, range: impl RangeBounds<usize>) -> A::Output
pub fn fold(&mut self, range: impl RangeBounds<usize>) -> A::Output
区間range
で計算を集約して返す。
Sourcepub fn update(&mut self, range: impl RangeBounds<usize>, x: A::Lazy)
pub fn update(&mut self, range: impl RangeBounds<usize>, x: A::Lazy)
区間range
を値x
で更新する。
Auto Trait Implementations§
impl<A> Freeze for LazySegtree<A>
impl<A> RefUnwindSafe for LazySegtree<A>
impl<A> Send for LazySegtree<A>
impl<A> Sync for LazySegtree<A>
impl<A> Unpin for LazySegtree<A>
impl<A> UnwindSafe for LazySegtree<A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more