pub struct Day23 { /* private fields */ }
Expand description
2016 Day 23: Interpreting assembunny assembly, again.
The key optimization is that
cpy $r1 $r2
inc $r3
dec $r2
jnz $r2 -2
dec $r4
jnz $r4 -5
can be replaced with $r3 = $r1 * r3
followed by $r2 = 0
and $r4 = 0
. This reduces the
number of simulated cycles for part 2 ~2,000,000 times when using the previously implemented
addition optimization, and ~6,000,000 times compared to a naive implementation.
See also 2016 day 12.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Day23
impl RefUnwindSafe for Day23
impl Send for Day23
impl Sync for Day23
impl Unpin for Day23
impl UnwindSafe for Day23
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)