racket192
2019-12-18 05:27:29

OK call me crazy but I finally got to Day 5 and I want to write a DSL for the intcode computer. Worth it?


sorawee
2019-12-18 07:14:13

Intcode problems are featured every other day, so having a good infrastructure to deal with it is definitely worthwhile. That being said, I don’t think a DSL will really help. So far, the problem statements don’t ask you to program inside the Intcode language. But if you just want to do it for fun, I’d say go for it!


sorawee
2019-12-18 07:16:13

Spoiler - Day 18 Part 1


sorawee
2019-12-18 07:18:28

The best algorithm I can come up for now is O(n^2 * (3^n)). (It’s an adaptation of https://en.wikipedia.org/wiki/Held%E2%80%93Karp_algorithm for this problem).


sorawee
2019-12-18 07:20:18

But n = 26, meaning that it will definitely be too slow. Assuming CPU could run 10^9 instructions per sec, it will take millions seconds to compute an answer


sorawee
2019-12-18 07:22:18

Perhaps it uses the fact that the graph is planar?


wanderley.guimaraes
2019-12-18 07:47:27

Why 3^n?


wanderley.guimaraes
2019-12-18 07:47:55

You either have a key to unlock a door or not.


wanderley.guimaraes
2019-12-18 07:49:06

I just finished the part 1 and I am going leave the part 2 for tomorrow.