Advent of Code 2025
December 7, 2025 · View on GitHub
My solution in Zig
This year I want to complete each day without brute force. I will see how long that lasts.
Instructions
Before building: Download inputs.
For day 1, go to https://adventofcode.com/2025/day/1/input to see your input for the day. ctrl+a and copy paste into day01/input.txt.
The process is the same for the other days.
Building
Make sure you have Zig 0.15
To build a specific day, cd into that day's folder, and run:
zig build
To run the executable, use either
zig build run
or
./zig-out/bin/adventofcode
To build with optimizations, run
zig build -Doptimize=ReleaseFast
Bechmarking
The root folder has its own build script, running zig build in the root folder will build all day's solutions.
Running the time step will use hyperfine to time each day's solution. I will try my best to keep each day under 1ms on my laptop.
zig build -Doptimize=ReleaseFast time
Speed
These are the speeds on my laptop.
| day | Time (mean ± σ) | Range (min … max) |
|---|---|---|
| 1 | 285.8 µs ± 79.7 µs | 147.4 µs … 1476.6 µs |
| 2 | 355.2 µs ± 92.7 µs | 190.6 µs … 1679.4 µs |
| 3 | 218.9 µs ± 69.3 µs | 130.3 µs … 1495.9 µs |
| 4 | 490.9 µs ± 111.6 µs | 228.9 µs … 1994.8 µs |
| 5 | 377.8 µs ± 112.9 µs | 210.2 µs … 1877.2 µs |
| 6 | 341.4 µs ± 87.2 µs | 167.7 µs … 1648.7 µs |
| 7 | 172.5 µs ± 57.8 µs | 110.3 µs … 1407.7 µs |