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 Freeze for Hld
impl RefUnwindSafe for Hld
impl Send for Hld
impl Sync for Hld
impl Unpin for Hld
impl UnsafeUnpin 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