pub struct Day19 { /* private fields */ }
Expand description
2016 Day 19: Finding the winners of counting-out games.
Implementations§
source§impl Day19
impl Day19
pub fn new(input: &str, _: InputType) -> Result<Self, InputError>
sourcepub fn part2(&self) -> u32
pub fn part2(&self) -> u32
See https://www.reddit.com/r/adventofcode/comments/5j4lp1/2016_day_19_solutions/.
If the number of elves is a power of 3, the final elf wins. Otherwise, calculate the
largest power of 3 smaller or equal to the number of elves (pow3
). Less than 2 * pow3
the winner is elves - pow3
, and after that it 2 * (elves - pow3) + pow3
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Day19
impl RefUnwindSafe for Day19
impl Send for Day19
impl Sync for Day19
impl Unpin for Day19
impl UnwindSafe for Day19
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
)