diff --git a/2024/Day05/README.md b/2024/Day05/README.md
new file mode 100644
index 00000000..d13907a7
--- /dev/null
+++ b/2024/Day05/README.md
@@ -0,0 +1,8 @@
+## --- Day 5: Print Queue ---
+Satisfied with their search on Ceres, the squadron of scholars suggests subsequently scanning the stationery stacks of sub-basement 17.
+
+The North Pole printing department is busier than ever this close to Christmas, and while The Historians continue their search of this historically significant facility, an Elf operating a [very familiar printer](/2017/day/1) beckons you over.
+
+The Elf must recognize you, because they waste no time explaining that the new sleigh launch safety manual updates won't print correctly. Failure to update the safety manuals would be dire indeed, so you offer your services.
+
+Read the [full puzzle](https://adventofcode.com/2024/day/5).
diff --git a/2024/Day05/Solution.cs b/2024/Day05/Solution.cs
new file mode 100644
index 00000000..678de727
--- /dev/null
+++ b/2024/Day05/Solution.cs
@@ -0,0 +1,50 @@
+namespace AdventOfCode.Y2024.Day05;
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+[ProblemName("Print Queue")]
+class Solution : Solver {
+
+ public object PartOne(string input) {
+ var (expected, updates) = Parse(input);
+ return updates
+ .Where(pages => Sorted(expected, pages))
+ .Sum(GetMiddlePage);
+ }
+
+ public object PartTwo(string input) {
+ var (expected, updates) = Parse(input);
+ return updates
+ .Where(pages => !Sorted(expected, pages))
+ .Select(pages => Sort(expected, pages))
+ .Sum(GetMiddlePage);
+ }
+
+ (HashSet expected, string[][] updates) Parse(string input) {
+ var parts = input.Split("\n\n");
+ var expected = new HashSet(parts[0].Split("\n"));
+ var updates = parts[1].Split("\n").Select(line => line.Split(",")).ToArray();
+ return (expected, updates);
+ }
+ int GetMiddlePage(string[] nums) => int.Parse(nums[nums.Length / 2]);
+
+ // checks that all possible pairs in pages are in the right order
+ bool Sorted(HashSet expected, string[] pages) {
+ var actuals = (
+ from i in Enumerable.Range(0, pages.Length - 1)
+ from j in Enumerable.Range(i + 1, pages.Length - i - 1)
+ select pages[i] + "|" + pages[j]
+ );
+ return actuals.All(expected.Contains);
+ }
+
+ string[] Sort(HashSet expected, string[] pages) {
+ // Ideally we would do some topological sorting, but it's an overkill for today.
+ // A single call to Array.Sort solves my input, so that' how life is... I might
+ // get back to this later but probably not :D
+ Array.Sort(pages, (page1, page2) => expected.Contains(page1 + "|" + page2) ? -1 : 1);
+ return pages;
+ }
+}
\ No newline at end of file
diff --git a/2024/Day05/input.in b/2024/Day05/input.in
new file mode 100644
index 00000000..258e15c8
Binary files /dev/null and b/2024/Day05/input.in differ
diff --git a/2024/Day05/input.refout b/2024/Day05/input.refout
new file mode 100644
index 00000000..4d6180ed
--- /dev/null
+++ b/2024/Day05/input.refout
@@ -0,0 +1,2 @@
+4790
+6319
\ No newline at end of file
diff --git a/2024/SplashScreen.cs b/2024/SplashScreen.cs
index 3138a852..4efa3083 100644
--- a/2024/SplashScreen.cs
+++ b/2024/SplashScreen.cs
@@ -8,8 +8,8 @@ public void Show() {
var color = Console.ForegroundColor;
Write(0xcc00, false, " ▄█▄ ▄▄█ ▄ ▄ ▄▄▄ ▄▄ ▄█▄ ▄▄▄ ▄█ ▄▄ ▄▄▄ ▄▄█ ▄▄▄\n █▄█ █ █ █ █ █▄█ █ █ █ █ █ █▄ ");
- Write(0xcc00, false, " █ █ █ █ █ █▄█\n █ █ █▄█ ▀▄▀ █▄▄ █ █ █▄ █▄█ █ █▄ █▄█ █▄█ █▄▄ $year = 2024\n ");
- Write(0xcc00, false, "\n ");
+ Write(0xcc00, false, " █ █ █ █ █ █▄█\n █ █ █▄█ ▀▄▀ █▄▄ █ █ █▄ █▄█ █ █▄ █▄█ █▄█ █▄▄ /* 2024 */\n \n ");
+ Write(0xcc00, false, " ");
Write(0xcccccc, false, ".--'");
Write(0xe3b585, false, "~ ~ ~");
Write(0xcccccc, false, "| .-' ");
@@ -48,9 +48,9 @@ public void Show() {
Write(0xcccccc, false, "| 3 ");
Write(0xffff66, false, "**\n ");
Write(0xcccccc, false, "|");
- Write(0x1461f, false, "@");
+ Write(0x427322, false, "@");
Write(0x5eabb4, false, "..");
- Write(0x7fbd39, false, "@");
+ Write(0x488813, false, "@");
Write(0xe3b585, false, "'. ~ ");
Write(0xcc00, false, "\" ' ");
Write(0xe3b585, false, "~ ");
@@ -66,21 +66,35 @@ public void Show() {
Write(0xcc00, false, ".'");
Write(0xcccccc, false, "| 4 ");
Write(0xffff66, false, "**\n ");
- Write(0x333333, false, "| | | .. | ");
- Write(0x666666, false, " 5\n 6\n ");
- Write(0x666666, false, " 7\n 8\n ");
- Write(0x666666, false, " 9\n ");
- Write(0x666666, false, " 10\n 11\n ");
- Write(0x666666, false, " 12\n ");
- Write(0x666666, false, " 13\n 14\n ");
- Write(0x666666, false, " 15\n ");
- Write(0x666666, false, " 16\n 17\n ");
- Write(0x666666, false, " 18\n ");
- Write(0x666666, false, " 19\n 20\n ");
- Write(0x666666, false, " 21\n ");
- Write(0x666666, false, " 22\n 23\n ");
- Write(0x666666, false, " 24\n ");
- Write(0x666666, false, "25\n \n");
+ Write(0xcccccc, false, "|");
+ Write(0x4d8b03, false, "_");
+ Write(0x5eabb4, false, ".~.");
+ Write(0x1461f, false, "_");
+ Write(0x7fbd39, false, "#");
+ Write(0xe3b585, false, "'.. ~ ~ ");
+ Write(0xffff66, true, "*");
+ Write(0xcccccc, false, "| | ");
+ Write(0xaaaaaa, false, "_| |_ ");
+ Write(0xcccccc, false, "..\\_");
+ Write(0x886655, false, "\\_ ");
+ Write(0xcc00, false, "..'");
+ Write(0xffff66, true, "* ");
+ Write(0xcccccc, false, "| 5 ");
+ Write(0xffff66, false, "**\n ");
+ Write(0x333333, false, "| | | .' '. | ");
+ Write(0x666666, false, " 6\n 7\n ");
+ Write(0x666666, false, " 8\n 9\n ");
+ Write(0x666666, false, " 10\n ");
+ Write(0x666666, false, " 11\n 12\n ");
+ Write(0x666666, false, " 13\n ");
+ Write(0x666666, false, " 14\n 15\n ");
+ Write(0x666666, false, " 16\n ");
+ Write(0x666666, false, " 17\n 18\n ");
+ Write(0x666666, false, " 19\n ");
+ Write(0x666666, false, " 20\n 21\n ");
+ Write(0x666666, false, " 22\n ");
+ Write(0x666666, false, " 23\n 24\n ");
+ Write(0x666666, false, " 25\n \n");
Console.ForegroundColor = color;
Console.WriteLine();
diff --git a/2024/calendar.svg b/2024/calendar.svg
index e9b16486..952e3d1c 100644
--- a/2024/calendar.svg
+++ b/2024/calendar.svg
@@ -1,4 +1,4 @@
-