pub struct Day25 { /* private fields */ }
Expand description
2016 Day 25: Finding patterns in interpreted assembunny assembly output.
cpy $N $r3
jnz $r2 2
jnz 1 6
dec $r2
dec $r3
jnz $r3 -4
inc $r1
jnz 1 -7
can be replaced with $r1 += $r2 / $N
, followed by $r3 = $N - ($r2 % $N)
and $r2 = 0
.
This reduces the number of simulated cycles for ~300 times when using the previously implemented
addition optimization, and ~400 times compared to a naive implementation.
See also 2016 day 12 and 2016 day 23.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Day25
impl RefUnwindSafe for Day25
impl Send for Day25
impl Sync for Day25
impl Unpin for Day25
impl UnwindSafe for Day25
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
)