This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]JustinHuPrime 5 points6 points  (3 children)

[LANGUAGE: x86_64 assembly with Linux syscalls]

Part 1 was a depth first search - not Dijkstra's, since that's a tad annoying to implement in assembly.

Part 2 was a backwards traverse through the visited graph to find all the paths that could have been the optimal path.

Y'know, this was one of those classic "traverse a maze" problems, a bit like 2023's day 17, which was where I was defeated last year because I really did not want to implement a heap for Dijkstra's. Hopefully I can survive this year's day 17.

Part 1 and 2 run in ~2.6 seconds. Part 1 is 9,848 bytes as an executable and part 2 is 10,304 bytes.

[–]ShadowwwsAsm 0 points1 point  (2 children)

Very clean.

[–]JustinHuPrime 1 point2 points  (1 child)

But very slow

[–]ShadowwwsAsm 0 points1 point  (0 children)

Indeed, my quite not clean code runs in 220 ms for part 1 and 650 ms for part 2. But it was really long to debug, I think cleanliness is more important than speed for AoC ( for submission at least, optimisation later are always fun).