pub struct Hld { /* private fields */ }
Expand description
HL 分解。
https://codeforces.com/blog/entry/53170, Easiest HLD with subtree queries.
Implementations§
source§impl Hld
impl Hld
pub fn new(g: Vec<Vec<usize>>, r: usize) -> Self
pub fn lca_decoded(&self, ou: usize, ov: usize) -> usize
pub fn path( &self, ou: usize, ov: usize ) -> impl Iterator<Item = (HlEdge, Direction)>
pub fn subtree_range(&self, ov: usize) -> (usize, usize)
pub fn encode(&self, ov: usize) -> usize
pub fn decode(&self, v: usize) -> usize
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Hld
impl Send for Hld
impl Sync for Hld
impl Unpin for Hld
impl UnwindSafe for Hld
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