Yeah, I know the feeling, I still haven't done it because of a few other commitments, I was thinking a dynamic programming solution with a list of changes … Alternatively could also be reduced to a BFS or IDDLS however it's not working in my head clearly by approaching it in a newish language. Each adjacent edge would obviously be a logical possible move and each node a state for all 4 floors to be at.
It's simple enough to code up a system that brute forces all possibilities. That works fine for the four item toy example but does not scale. So I tried A* search. A* requires a move heuristic, which isn't necessarily bad or hard. However, you pretty much need a state-equivalence heuristic as well because the branching factor is still too high. I don't have that heuristic, and it's going to be some work/refactoring to add it.
I think I'll work on day 12 and come back to 11 later.
I worked out the answer to #11 with a couple of guesses and some math and didn't even write a program, but I haven't got a proof of correctness as yet so it may yet be the case that my answer is not correct for all possible inputs.
I worked out the answer to #11 with a couple of guesses and some math and didn't even write a program, but I haven't got a proof of correctness as yet so it may yet be the case that my answer is not correct for all possible inputs.
I did the same. In fact, I'm pretty sure it's not correct.
Started designing an experimental drum synth on paper today, will probably get specs finalized before diving on it. Intentions being set on iOS publishing.
I've fallen way behind on these what with finals at all. I'm hoping 11 won't be too bad because I'm more confidant in my math than my coding (thanks Project Euler).
I worked out the answer to #11 with a couple of guesses and some math and didn't even write a program, but I haven't got a proof of correctness as yet so it may yet be the case that my answer is not correct for all possible inputs.
I did the same. In fact, I'm pretty sure it's not correct.
I wasn't a fan of 11.
Yeah, I think I have a reasonable counter-example now, which means I was lucky that I got an "easy" input for Day 11.
I don't think that's an issue with the problem though, but rather an issue with only giving each person a single input case they need to handle.
Also, I do still suspect that the problem may well be solvable in the general case via a locally greedy algorithm without any kind of search; I'll have to spend a little bit more time on it to see if I can find one.
Finally got some free time at work to get back on this. Did 9.5 in a few minutes.
10 seems easy enough, but the actual instructions aren't entirely clear. Does the order the instructions appear in the input file matter at all? It seems like the input file simply describes the rules of the machine, and I can just build it and run it until I see the answer. Yes/no?
Finally got some free time at work to get back on this. Did 9.5 in a few minutes.
10 seems easy enough, but the actual instructions aren't entirely clear. Does the order the instructions appear in the input file matter at all? It seems like the input file simply describes the rules of the machine, and I can just build it and run it until I see the answer. Yes/no?
I think you're right, order doesn't matter, I also haven't gotten mine working though so I might be wrong. 9.5 is giving me trouble. I can get it working for the test files but when I try to run it on my input it never stops, might just let it run for a few hours. I see you did it with regex, probably a better solution than mine.
Finally got some free time at work to get back on this. Did 9.5 in a few minutes.
10 seems easy enough, but the actual instructions aren't entirely clear. Does the order the instructions appear in the input file matter at all? It seems like the input file simply describes the rules of the machine, and I can just build it and run it until I see the answer. Yes/no?
I think you're right, order doesn't matter, I also haven't gotten mine working though so I might be wrong. 9.5 is giving me trouble. I can get it working for the test files but when I try to run it on my input it never stops, might just let it run for a few hours. I see you did it with regex, probably a better solution than mine.
Yeah, for 9.5 I just copy-pasta'd my 9.0 solution with two changes. First, obviously, I used recursion because that's what 9.5 is about. Second, I only returned and multiplied lengths rather than the actual decompressed strings because that's also what the problem was about. Still, I think if I did it on my home PC or a cloud VM I could have decompressed the entire string and run len() on it.
Finally got some free time at work to get back on this. Did 9.5 in a few minutes.
10 seems easy enough, but the actual instructions aren't entirely clear. Does the order the instructions appear in the input file matter at all? It seems like the input file simply describes the rules of the machine, and I can just build it and run it until I see the answer. Yes/no?
I think you're right, order doesn't matter, I also haven't gotten mine working though so I might be wrong. 9.5 is giving me trouble. I can get it working for the test files but when I try to run it on my input it never stops, might just let it run for a few hours. I see you did it with regex, probably a better solution than mine.
Yeah, for 9.5 I just copy-pasta'd my 9.0 solution with two changes. First, obviously, I used recursion because that's what 9.5 is about. Second, I only returned and multiplied lengths rather than the actual decompressed strings because that's also what the problem was about. Still, I think if I did it on my home PC or a cloud VM I could have decompressed the entire string and run len() on it.
Yeah, I'm trying the latter. I didn't expect it to take that long on a 6700k with 16 gb of ram.
I have also made the conscious decision to say fuck day 11 and not do it.
Ok, I just finished day 10. I see why you are all bitching about day 11. Methinks the person making these is not so good at writing. As the problems increase in complexity, they are having a hard time explaining them clearly. I would not hire them to write the rules to any board game, that's for sure.
Still, if I could just fully understand the instructions to day 11 I feel like I could solve it just by using a pencil and paper because the input file is so small. It's like professor layton level. My input is actually incredibly simple for some reason.
I must have missed that post, anyways, I added myself.
I tried doing yesterday's solution with an iterative deepening DLS but retreated to the more familiar BFS. I still think if I go back to it and rewrite the algorithm looking for the min string length I could get it to work. I'm also almost sure that it requires less code than the BFS, however I can't just go on a hunch.
Doing these in Python kind of makes me appreciate how easy and necessary a scripting language is. Cryptography is so simple (concise?) in comparison to C.
The lack of a standard format is kind of weird so I'm not sure of what best practice is, I've just been reading in input via file opening rather than reading in from stdin which is what I usually do.
It took me maybe a day or two to get comfortable enough to ditch an IDE and get back to writing in a text editor.
Comments
I think I'll work on day 12 and come back to 11 later.
I wasn't a fan of 11.
I don't think that's an issue with the problem though, but rather an issue with only giving each person a single input case they need to handle.
Also, I do still suspect that the problem may well be solvable in the general case via a locally greedy algorithm without any kind of search; I'll have to spend a little bit more time on it to see if I can find one.
10 seems easy enough, but the actual instructions aren't entirely clear. Does the order the instructions appear in the input file matter at all? It seems like the input file simply describes the rules of the machine, and I can just build it and run it until I see the answer. Yes/no?
9.5 is giving me trouble. I can get it working for the test files but when I try to run it on my input it never stops, might just let it run for a few hours. I see you did it with regex, probably a better solution than mine.
I have also made the conscious decision to say fuck day 11 and not do it.
Still, if I could just fully understand the instructions to day 11 I feel like I could solve it just by using a pencil and paper because the input file is so small. It's like professor layton level. My input is actually incredibly simple for some reason.
I hadn't thought any of the questions were unclear, until they had to make clarification edits for day 14.
111310-386fbb3e
.111686-e01a629f
I tried doing yesterday's solution with an iterative deepening DLS but retreated to the more familiar BFS. I still think if I go back to it and rewrite the algorithm looking for the min string length I could get it to work. I'm also almost sure that it requires less code than the BFS, however I can't just go on a hunch.
Doing these in Python kind of makes me appreciate how easy and necessary a scripting language is. Cryptography is so simple (concise?) in comparison to C.
The lack of a standard format is kind of weird so I'm not sure of what best practice is, I've just been reading in input via file opening rather than reading in from stdin which is what I usually do.
It took me maybe a day or two to get comfortable enough to ditch an IDE and get back to writing in a text editor.