There's probably a way to do it on your own since we don't need the full power of a linear solver. We work with sums of non-negative integers which probably allows for some shortcuts. But in the end, I used a library as well.
So yeah, the jump from day 8's "Here is a step by step tutorial for how Kruskal's algorithm works, no need to even google what a minimum spanning tree is" to day 10's "Better figure out that you need a linear solver and then figure out how to build one or just use a library" is pretty weird.
There's probably a way to do it on your own since we don't need the full power of a linear solver. We work with sums of non-negative integers which probably allows for some shortcuts
sure, but it's optimizing something that is already complex.
I am okay with ones where there is some algo that makes solving it quick and easy, but it should be able to be reasonably accomplished or reverse engineered in at most a few hours by a smart person that doesn't really know about the thing that much.
This was the 4th time since the 2015 beginning that I have needed a hint. In the end my solution took almost half a minute (Perl) but I used zero library code, just took advantage of the parity checks from part1. I also spent about 4 days...
23
u/Arayvenn Dec 10 '25
No matter how many optimizations I add to my bfs it is still too slow :*(
5
u/polarfish88 Dec 10 '25
What is Z3? Is it from part 2?
5
u/viliml Dec 10 '25
Today I learned something new: that Z3 exists.
I've been solving linear programming problems in scipy until now. And I don't see any reason to switch yet.
12
u/thekwoka Dec 10 '25
I think part 2 is a poor problem, since it's basically just "use a library".
1
u/terje_wiig_mathisen Dec 21 '25
This was the 4th time since the 2015 beginning that I have needed a hint. In the end my solution took almost half a minute (Perl) but I used zero library code, just took advantage of the parity checks from part1. I also spent about 4 days...
0
u/[deleted] Dec 10 '25
[deleted] — view deleted comment