Day 19 AoC: The factory must grow

16
Jump in the discussion.

No email address required.

k This one was though for bruteforce-chads like me, it made me thinkmaxx for a few hours and certainly C++ with its silent underflows and C arrays out of bounds accesses didn't help; but eventually I came with some not so bad heuristics to prune the solutions' space. I also started using multiple compilation units since I was getting tired of waiting several seconds for the single std::regex :marseysick: :marseydizzy: to compile. With -O3 I find the solution in 1 minute and 8 seconds

![](/images/16714774197533405.webp)

![](/images/16714774252523735.webp)

Btw I used multiprocessing ( @Schizo @Schizo discuss)

:#marseythreadprocessrentfree:

Jump in the discussion.

No email address required.

totale 5,8M
drwxr-xr-x  2 schizocel schizocel 4,0K 19 dic 21.09 ./
drwxr-xr-x 18 schizocel schizocel 4,0K 19 dic 08.48 ../
-rwxr-xr-x  1 schizocel schizocel 2,5M 19 dic 19.53 aoc*
-rw-r--r--  1 schizocel schizocel   47 19 dic 19.49 attempts
-rw-r--r--  1 schizocel schizocel 1,4K 19 dic 19.15 blueprint.cpp
-rw-r--r--  1 schizocel schizocel  515 19 dic 18.20 blueprint.hpp
-rw-r--r--  1 schizocel schizocel 2,8M 19 dic 19.26 blueprint.o
-rw-r--r--  1 schizocel schizocel 4,8K 19 dic 19.40 input
-rw-r--r--  1 schizocel schizocel 1,5K 19 dic 19.53 main.cpp
-rw-r--r--  1 schizocel schizocel 289K 19 dic 19.53 main.o
-rw-r--r--  1 schizocel schizocel  375 19 dic 21.09 Makefile
-rw-r--r--  1 schizocel schizocel  320 19 dic 08.50 sample.input
-rw-r--r--  1 schizocel schizocel 3,5K 19 dic 19.50 sim.cpp
-rw-r--r--  1 schizocel schizocel  638 19 dic 19.42 sim.hpp
-rw-r--r--  1 schizocel schizocel 185K 19 dic 19.53 sim.o
-rw-r--r--  1 schizocel schizocel  161 19 dic 19.15 test.input

Also isn't nice how blueprint.o which is literally just a std::regex is the biggest of the compilation units?

:#marseysociety2::#joanmarsey:

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.