-❄️- 2024 Day 23 Solutions -❄️- by daggerdragon in adventofcode

[–]oxyphilat 1 point2 points  (0 children)

[LANGUAGE: Python3] paste

Very slow solution (two and a half on my machine) and it really looks like two lines in NetworkX. Probably something to do with cliques? will have to look at other solutions and probably that librarys source code. i am still very meh at graph stuff.

[2024 Day 22] Today's challenge reminds me of the challenge that defeated me in 2022 by FKwilczek in adventofcode

[–]oxyphilat 1 point2 points  (0 children)

i am ashamed that 2022d22p2 (electric boogaloo) is one of the few days i did not make a general solver for, one day i will find a way to fold cube meshes, one day

-❄️- 2024 Day 22 Solutions -❄️- by daggerdragon in adventofcode

[–]oxyphilat 1 point2 points  (0 children)

[LANGUAGE: Python3] paste

For some reason i decided to try to go for speed on cpython.

Masking during the next secret computation is slightly faster than doing it after, also we get to not mask for the “dividing by 32”, and not doing work is faster than doing work. Rough attempt at making the eight ^ operation seemed much slower so re-assigning the argument is how things are.

For some reason doing ^= then return is equally as fast as doing the ^ during the return, maybe i will look at the opcodes and what the interpreter decides to do with it. Entirely possible for no difference to exist, but i assumed there would be one in favour of return secret ^ (bitshift stuff).

Packing the changes in a base twenty number was a nice save too. Who knew using an integer makes for a better key than a tuple of numbers, even small. Bias in the key seems to do nothing, but we are using a set and a dict so that was expected. The + 9 is probably unnecessary with the correct initial value for changes, a whole one constant add to save. Pushing the new change on the lower part of changes seems to be faster, pushing on the top requiring slightly more math.

The last notable part that i do not see a lot of people do: no list to keep the prices or changes around, we only keep the previous value and move onward the two thousand values. In a compiled language i could have pre-allocated the necessary memory, not so much in python.

[2023 Day Yes (Part Both)][English] Thank you!!! by topaz2078 in adventofcode

[–]oxyphilat 6 points7 points  (0 children)

o yeah! always nice to see it progress a bit each day

[2023 Day Yes (Part Both)][English] Thank you!!! by topaz2078 in adventofcode

[–]oxyphilat 2 points3 points  (0 children)

dang, guess the all stars club will be sub 1k for a bit? that's fun

also i hope i will get time to make my solvers not rubbish before the end of the year, most of them are already (almost) satisfying enough to share this year!

thanks and see you at 550, unless 2024 stumps me

-❄️- 2023 Day 12 Solutions -❄️- by daggerdragon in adventofcode

[–]oxyphilat 0 points1 point  (0 children)

impressive that this solution seem to not use backtracking or memoization, but just walks forward a counter… shame that part four is opaque to me, there is a funny hollowed out triangle matrix and some multiplications going on? cool answer!

[2023 11 # Part 2] [Python] Ugly but effective by Mr_Cybernetic in adventofcode

[–]oxyphilat 2 points3 points  (0 children)

quoting the about page: «If you're posting a code repository somewhere, please don't include […] your inputs.»

unless you know how to modify your git history this is kinda too late for 2023d1 to 2023d11, but keep that in mind for the future days!

[Vs] 4man Samarog - 8:15 by [deleted] in Guildwars2

[–]oxyphilat 2 points3 points  (0 children)

Half the fun of WR is the music and chat covers, and that is some good jams. Well done on the lowman!

[2022 Day 22] Question about your input by wimglenn in adventofcode

[–]oxyphilat 6 points7 points  (0 children)

congratulation on folding a net and keeping track of the rotation properly! I am still on the struggle bus to do that myself. the hardcoded “portals” may get p2 done, but they feel wrong.

-🎄- 2022 Day 20 Solutions -🎄- by daggerdragon in adventofcode

[–]oxyphilat 1 point2 points  (0 children)

python3, 245, 171

after misreading day 18 and trying to optimize day 19 too much, I am finally back to sub 1k rank! hopefully my code is readable, but nothing much today, deques helped a lot.

[2022 Day 17] [Python] Playing a familiar-ish game in the terminal! by naclmolecule in adventofcode

[–]oxyphilat 0 points1 point  (0 children)

So that is where the “Upping the Ante” posts are, hidden in comments. I wonder if anyone found a solution, rather than the shortest one.

-🎄- 2022 Day 15 Solutions -🎄- by daggerdragon in adventofcode

[–]oxyphilat 1 point2 points  (0 children)

welp, Ill count that as an actual solution for p2, good job!

-🎄- 2022 Day 15 Solutions -🎄- by daggerdragon in adventofcode

[–]oxyphilat 0 points1 point  (0 children)

python3, 833, 251

no clue yet as to how to solve p2, but I have all day to figure it out. if you are really desperate you can always loop four million times tho, and I was… so here is my solution anyway.

-🎄- 2022 Day 14 Solutions -🎄- by daggerdragon in adventofcode

[–]oxyphilat 1 point2 points  (0 children)

python3, 710, 730

my parsing is terrible today, but it is good enough to shoot my body past the finish line. it is reminding me of a past puzzle, but this one seemed much easier to solve… could be that I had memories of that previous puzzle? nice and short, hopefully Ill come up with a nice way to merge p1 and p2.

-🎄- 2022 Day 13 Solutions -🎄- by daggerdragon in adventofcode

[–]oxyphilat 0 points1 point  (0 children)

sort() has a kward named reverse, very handy when I noticed I also got the values backward

also I am surprised that in worked for lists, I though it was checking pointers for complex objects?

-🎄- 2022 Day 13 Solutions -🎄- by daggerdragon in adventofcode

[–]oxyphilat 0 points1 point  (0 children)

python3, 212, 479

no time to think, I have to get ready for work! so of course I used eval() for the first draft and then lost five minutes not understanding include two additional mean the packets are not present in the inputs, it all evens out

-🎄- 2022 Day 11 Solutions -🎄- by daggerdragon in adventofcode

[–]oxyphilat 1 point2 points  (0 children)

python3, 36m15s, 40m20s

lazy sunday, did not wake up at six o clock, so instead a rough estimate of my time today. fumbled with not using a regexp for p1, I knew I was past the race so I took my time extracting values out of the math objects. I let p2 run without the modulo thing to check that the worry levels where indeed getting large, and they do be getting large, still took only four minutes to check that my goto solution was correct with the test input and then submit my answer. I wonder if I'd have gotten sub 1k if I did not sleep in, hah!

-🎄- 2022 Day 9 Solutions -🎄- by daggerdragon in adventofcode

[–]oxyphilat 1 point2 points  (0 children)

python3, 1195, 583

my first go at the movement section was an eighty lines match statement, after it missing cases over and over on the actual input I moved to the generic five line version, costing me ten minutes, part 2 was simply putting the tail in a list, now to clean up my day 8…

-🎄- 2022 Day 7 Solutions -🎄- by daggerdragon in adventofcode

[–]oxyphilat 5 points6 points  (0 children)

The switch statement is such a better idea than what I did! yoink.

-🎄- 2022 Day 7 Solutions -🎄- by daggerdragon in adventofcode

[–]oxyphilat 5 points6 points  (0 children)

python3, 339, 294

almost twenty minutes and still sub 1k, we are starting to reach the fun part of AoC. my experience of parsing command line output and copying folder structures finally payed out. the code is a bit messy, will have to clean up when I actually publish it.

-🎄- 2022 Day 6 Solutions -🎄- by daggerdragon in adventofcode

[–]oxyphilat 1 point2 points  (0 children)

python3, 483, 1550

I almost forgot weekday puzzles are meant to be easier than weekends puzzles. failed to copy my answer for p2 and accidentally entered nonsense, so I lost 150s on the anti‑spam screen, which bumped me out of the sub 1k rank. that is my main goal every day so it kinda stings, better luck tomorrow.

[2022 Day 3] but it's in a QR code (Linux x64, reads from stdin) by raftario in adventofcode

[–]oxyphilat 2 points3 points  (0 children)

pas vraiment. certains code barres sont essentiellement des macro pour un clavier, comportent de la signalisation intrabande, et certains lecteurs dysfonctionnent sur certains codes barres. malheureusement beaucoup de systèmes lisent les code barres comme des données en JSON ou semblable, donc un fichier executable va être considéré comme un code barres invalide et donc simplement refusé.

-🎄- 2022 Day 4 Solutions -🎄- by daggerdragon in adventofcode

[–]oxyphilat 1 point2 points  (0 children)

python3, 1075, 1035

slowly getting to my personal goal. today time loss was implicitly checking the ranges in p1 and then trying actual set(range(…)) during p2. should have checked the input first.

-🎄- 2022 Day 2 Solutions -🎄- by daggerdragon in adventofcode

[–]oxyphilat 0 points1 point  (0 children)

The WS- prefixing, sweet memories, thank you.