Skip to content

Commit

Permalink
use smallvec for supports/supporting on day 22
Browse files Browse the repository at this point in the history
  • Loading branch information
kcaffrey committed Dec 22, 2023
1 parent 457c478 commit 63b6873
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ Solutions for [Advent of Code](https://adventofcode.com/) in [Rust](https://www.
| [Day 19](./src/bin/19.rs) | `83.9µs` | `90.9µs` |
| [Day 20](./src/bin/20.rs) | `323.9µs` | `1.2ms` |
| [Day 21](./src/bin/21.rs) | `64.1µs` | `494.7µs` |
| [Day 22](./src/bin/22.rs) | `138.3µs` | `277.2µs` |
| [Day 22](./src/bin/22.rs) | `94.4µs` | `224.7µs` |

**Total: 16.75ms**
**Total: 16.65ms**
<!--- benchmarking table --->

---
Expand Down
5 changes: 3 additions & 2 deletions src/bin/22.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use rayon::iter::{IntoParallelIterator, ParallelIterator};
use smallvec::SmallVec;

advent_of_code::solution!(22);

Expand Down Expand Up @@ -138,8 +139,8 @@ struct Brick {
#[derive(Debug, Clone)]
struct Tower {
bricks: Vec<Brick>,
supports: Vec<Vec<usize>>,
supported: Vec<Vec<usize>>,
supports: Vec<SmallVec<[usize; 16]>>,
supported: Vec<SmallVec<[usize; 16]>>,
top_view: Grid2<(usize, u16)>,
}

Expand Down

0 comments on commit 63b6873

Please sign in to comment.