57 lines
2.2 KiB
Markdown
57 lines
2.2 KiB
Markdown
# Advent of Code 2025
|
|
|
|
https://adventofcode.com/2025
|
|
|
|
## Building
|
|
Everything is handled by cmake which most ide's can handle.
|
|
Make sure you have a compiler (MSVC or GCC), CMake, and make/ninja installed.
|
|
|
|
If you're using make to build the project, run the following commands:
|
|
1. `mkdir build`
|
|
2. `cd build`
|
|
3. `cmake .. -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles"`
|
|
4. `make -j <number of threads>`
|
|
|
|
If you're using ninja to build the project, run the following commands:
|
|
1. `mkdir build`
|
|
2. `cd build`
|
|
3. `cmake .. -DCMAKE_BUILD_TYPE=Release -G Ninja`
|
|
4. `ninja`
|
|
|
|
## Directory structure
|
|
|
|
- `src`: Contains the source code for each day.
|
|
- `src/common`: Contains some generalized headers that are used by multiple days.
|
|
- `src/dayX`: Contains the source code for day `X
|
|
- `src/dayx/pY`: Contains the source code for part `Y` of day `X`
|
|
- `input`: Contains the input for each day.
|
|
|
|
## Types
|
|
During this challenge, I plan to have multiple different
|
|
types of solutions.
|
|
|
|
- Normal: A more "normal" solution, opting for more readable code without doing anything fancy.
|
|
- Faf: The fastest solution I can think of.
|
|
|
|
Each solution has its own executable following the following naming convention: `dXpY-type`. Where `X` is the day number, `pY` is the part number, and `type` is the type of solution (Normal omits the type all together Ex: a normal day1 part1 executable would be `d1p1`).
|
|
|
|
## Benchmarks
|
|
|
|
All benchmarks are running using the timer class defined in `src/common/timer.h`. <br>
|
|
"Normal" solutions are only run once, as they aren't designed to be as fast as possible.<br>
|
|
"Faf" solutions are run multiple times to get a more accurate average.<br>
|
|
All benchmarks include file IO, mostly because everything calculates within single digit microseconds or less.
|
|
|
|
All benchmarks are run on a system with the following specs:
|
|
- CPU: AMD Ryzen 9 8945HS
|
|
- RAM: 32GB DDR5 6000MHz
|
|
- SSD: Samsung 990 Pro
|
|
- OS: Windows 11 24H2
|
|
- Compiler: gcc version 13.2.0 (x86_64-posix-seh-rev0, Built by MinGW-Builds project)
|
|
|
|
| Day | Part | Type | Time (us) | Iterations |
|
|
|-----|------|--------|-----------|------------|
|
|
| 1 | 1 | faf | 43 | 100000 |
|
|
| 1 | 1 | Normal | 483 | 1 |
|
|
| 1 | 2 | Normal | 472 | 1 |
|