My Advent of Code 2023 solutions in the Rust programming language. This repository holds a separate Rust project for each day and part.
I attempt to develop a standalone, elegant, compact and fast solution for each problem (two each day).
Two years ago I did the same, solving everything in under a second:
- https://timvisee.com/blog/solving-aoc-2020-in-under-a-second/
- https://github.com/timvisee/advent-of-code-2021
- https://github.com/timvisee/advent-of-code-2020
Here is how long each solution runs with my input. All solutions are measured
(non scientifically) in bench.rs
on an AMD Ryzen 9 5900X (24) @ 3.7GHz
machine running Linux.
one-by-one (1 CPU core) | parallel | |
---|---|---|
everything | 0.77 ms |
0.32 ms |
Each Rust project needs a input.txt
file to run, holding the puzzle input.
Simply create this file with your input and run the project to see the solution
appear.
# Switch to day 1a, add input, and run it
cd day01a
nano input.txt
cargo +nightly run --release
# or run everything in parallel
cd ../runner
cargo +nightly run --release --bin runner-par
# or benchmark every day
cd ../runner
cargo +nightly run --release --bin bench
Some solutions require Rust Nightly, that's why +nightly
is included.
Sadly I cannot include my puzzle input anymore to make each solution easily runnable as per Advent of Code FAQ:
If you're posting a code repository somewhere, please don't include parts of Advent of Code like the puzzle text or your inputs.
This project is released under the GNU GPL-3.0 license. Check out the LICENSE file for more information.