pub enum SupplyDemand {}
Expand description
Supply & Demand, based on https://codeforces.com/gym/102218/problem/F update(i, i, &(p, o)) increases supply by p and demand by o at time i. query(l, r) computes total supply and demand at times l to r, as well as
Trait Implementations§
Source§impl ArqSpec for SupplyDemand
impl ArqSpec for SupplyDemand
Source§fn op((p1, o1, s1): &Self::S, (p2, o2, s2): &Self::S) -> Self::S
fn op((p1, o1, s1): &Self::S, (p2, o2, s2): &Self::S) -> Self::S
Must satisfy the Associative Law:
For all a,b,c, op(a, op(b, c)) = op(op(a, b), c)
Source§fn identity() -> Self::S
fn identity() -> Self::S
Must satisfy the Identity Law:
For all a, op(a, identity()) = op(identity(), a) = a
Auto Trait Implementations§
impl Freeze for SupplyDemand
impl RefUnwindSafe for SupplyDemand
impl Send for SupplyDemand
impl Sync for SupplyDemand
impl Unpin for SupplyDemand
impl UnwindSafe for SupplyDemand
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