Skip to content

timvisee/advent-of-code-2023

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code 2023 in Rust

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:

Timings

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.

part A part B
day 1 0.016 ms 0.028 ms
day 2 0.011 ms 0.016 ms
day 3 0.019 ms 0.018 ms
day 4 0.017 ms 0.017 ms
day 5 0.015 ms 0.034 ms
day 6 0.001 ms 0.001 ms
day 7 0.065 ms 0.066 ms
day 8 0.028 ms 0.122 ms
day 9 0.042 ms 0.042 ms
day 10 0.048 ms 0.095 ms
day 11 0.012 ms 0.008 ms
one-by-one (1 CPU core) parallel
everything 0.77 ms 0.32 ms

Run solutions

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.

Other years

License

This project is released under the GNU GPL-3.0 license. Check out the LICENSE file for more information.