current difficulties
- Day 21 - Keypad Conundrum: 01h01m23s
- Day 17 - Chronospatial Computer: 44m39s
- Day 15 - Warehouse Woes: 30m00s
- Day 12 - Garden Groups: 17m42s
- Day 20 - Race Condition: 15m58s
- Day 14 - Restroom Redoubt: 15m48s
- Day 09 - Disk Fragmenter: 14m05s
- Day 16 - Reindeer Maze: 13m47s
- Day 22 - Monkey Market: 12m15s
- Day 13 - Claw Contraption: 11m04s
- Day 06 - Guard Gallivant: 08m53s
- Day 08 - Resonant Collinearity: 07m12s
- Day 11 - Plutonian Pebbles: 06m24s
- Day 18 - RAM Run: 05m55s
- Day 04 - Ceres Search: 05m41s
- Day 23 - LAN Party: 05m07s
- Day 02 - Red Nosed Reports: 04m42s
- Day 10 - Hoof It: 04m14s
- Day 07 - Bridge Repair: 03m47s
- Day 05 - Print Queue: 03m43s
- Day 03 - Mull It Over: 03m22s
- Day 19 - Linen Layout: 03m16s
- Day 01 - Historian Hysteria: 02m31s
13 Comments
zogwarg@awful.systems · 3 pts · 1y
24! - Crossed Wires - Leaderboard time 01h01m13s (and a close personal time of 01h09m51s)
::: spoiler Spoilers I liked this one! It was faster the solve part 2 semi-manually before doing it "programmaticly", which feels fun.
Way too many lines follow (but gives the option to finding swaps "manually"):
:::
swlabr@awful.systems · 2 pts · 1y
I did part 2 manually! I will not bother writing a code solution unless I feel like it.
::: spoiler well well well AoC, so you thought you could dredge up my trauma as an EE grad by making me debug a full-adder logic circuit? How dare you. You succeeded. :::
swlabr@awful.systems · 2 pts · 1y
I did end up writing a code solution.
::: spoiler algorithm desc So basically the problem boils down to this:
A 1 bit full adder circuit with carry in/out is described as follows:
S
i= Xi^ Yi^ CiniCout
i= (Xi&& Yi) || (Cini&& (Xi^ Yi))Where S is the output bit, X and Y are the input bits, and Cin
iis the carry out bit of bit i-1. For the first and last bits of the output, the circuits are slightly different due to carry in/out not mattering in the 0/last bit case.Note that as said in the problem statement any input is correctly labelled, while outputs might be incorrect. You can then categorise each gate input/output as any of the elements in an adder circuit. You can then use set differences and intersections to determine the errors between categories. That's all you need to do!
For example, you might have something like:
X && Y = err
if this output was used correctly, it should show up as an operand to an OR gate. So if you did:
(Set of all outputs of and gates) - (Set of all inputs to or gates), if something appears, then you know one of the and gates is wrong.
Just exhaustively find all the relevant differences and intersections and you're done! To correct the circuit, you can then just brute force the 105 combinations of pair swaps to find what ends up correcting the circuit. :::
gerikson@awful.systems · 3 pts · 1y
It's a wrap!
One of the easier years imho. Better than last year in any case.
I get the feeling that this is Eric's way of saying goodbye, and that this might be the last year, but I might be wrong.
Puzzles by difficulty (leaderboard completion times)
swlabr@awful.systems · 2 pts · 1y
21!
Finally managed to beat this one into submission.
::: spoiler P1 I created this disgusting mess of a recursive search that happened to work. This problem was really hard to think about due to the levels of indirection. It was also hard because of a bug I introduced into my code that would have been easy to debug with more print statements, but hubris. :::
::: spoiler P2 Recursive solution from P1 was too slow, once I was at 7 robots it was taking minutes to run the code. It didn't take long to realise that you don't really care about where the robots other than the keypad robot and the one controlling the keypad robot are since the boundary of each state needs all the previous robots to be on the A button. So with memoisation, you can calculate all the shortest paths for a given robot to each of the directional inputs in constant time, so O(kn) all up where n is the number of robots (25) and k is the complexity of searching for a path over 5 or 11 nodes.
What helped was looking at the penultimate robot's button choices when moving the keypad robot. After the first one or two levels, the transitions settle into the table in the appendix. I will not explain the code. :::
::: spoiler appendix
:::
zogwarg@awful.systems · 2 pts · 1y
23!
::: spoiler Spoilerific Got lucky on the max clique in part 2, my solution only works if there are at least 2 nodes in the clique, that only have the clique members as common neighbours.
Ended up reading wikipedia to lift one the Bron-Kerbosch methods:
:::
gerikson@awful.systems · 3 pts · 1y
::: spoiler day 23
this is one of those days when it’s all about the right term to google right
:::
swlabr@awful.systems · 3 pts · 1y
::: spoiler thanks I've probably learned that term at some point, so thanks for naming it. That made me realise my algorithm was too thicc and could just be greedy. :::
Architeuthis@awful.systems · 3 pts · 1y
::: spoiler 23-2 Leaving something to run for 20-30 minutes expecting nothing and actually getting a valid and correct result: new positive feeling unlocked.
Now to find out how I was ideally supposed to solve it. :::
swlabr@awful.systems · 2 pts · 1y
22
::: spoiler uh pretty straightforward. At least it's not a grid! :::
swlabr@awful.systems · 2 pts · 1y
25!
::: spoiler p1 tips O(mn)/O(n^2^) is fast enough. :::
::: spoiler 50 stars baby! https://imgur.com/a/hwEVy9H :::
gerikson@awful.systems · 3 pts · 1y
congrats! I still have 6 stars to go, but I still think this was easier than last year.
zogwarg@awful.systems · 2 pts · 1y
And done! well I had fun.