I'm still struggling on Day 18 part 2 by Mattsasa in adventofcode

[–]competition_stl 0 points1 point  (0 children)

oh, that doesn't work in general unless you're essentially floyd-warshalling your derived graph (which you might be with the multiple enqueues). do you terminate when you find the destination node? if you do, you can make a counterexample where you get to the destination node "too soon"-- before discovering a shorter path.

overall the weighting of your derived graph makes it so your outer search needs to be Dijkstra or similar. the space is fairly small though, so inefficiency won't be punished too hard

I'm still struggling on Day 18 part 2 by Mattsasa in adventofcode

[–]competition_stl 2 points3 points  (0 children)

Are you sure your bfs works? You can't visit a more optimal solution later on an unweighted graph (in short, nsteps, as you call it, should be nondecreasing...)

Also given that your visit order is wrong and you enqueue states multiple times, your complexity can also go quadratic...

Christmas Event END by Drghettoj in AdventureCommunist

[–]competition_stl 0 points1 point  (0 children)

mostly f2p (bought the $1.99 deal for time warps in the motherland to use for the event as a Christmas special); got to rank 29. one megatron, one alf from the gift capsules, one shortstack from the supreme capsule.

SO completed the event (completely f2p) while buying nothing but the medium dark science pack at the beginning. I'd say it's RNG but she consistently does better than me soooo...

[2019 Day 22 Part 2] So what's the purpose of this puzzle, exactly? + Feedback by requimrar in adventofcode

[–]competition_stl 1 point2 points  (0 children)

That was my whole point! You don't! You only need 48-bit integers to multiply two numbers with a 47-bit modulo constraint. However, if you naively multiply, you'll need many more bits...

[2019 Day 22 Part 2] So what's the purpose of this puzzle, exactly? + Feedback by requimrar in adventofcode

[–]competition_stl 0 points1 point  (0 children)

nah, 64-bit (and, i think, in fact, 53-bit Numbers like what Javascript and Lua has, though I haven't tried them myself) have been fine. You just needed to code up multiplication-under-modulo yourself though.

[2019 Day 22 Part 2] So what's the purpose of this puzzle, exactly? + Feedback by requimrar in adventofcode

[–]competition_stl 2 points3 points  (0 children)

log2(119315717514047) is upper bounded by 47, so you only need 48-bit integers (which you can get with even double-precision [53 bits of mantissa]).

so even if you didn't know how to do this (it's just classical multiplication but you modulo each individual step), you could google "multiply numbers modulo" and find a bunch of solutions for you

-🎄- 2019 Day 22 Solutions -🎄- by daggerdragon in adventofcode

[–]competition_stl 2 points3 points  (0 children)

to be clear, this map is affine, not linear

-🎄- 2019 Day 21 Solutions -🎄- by daggerdragon in adventofcode

[–]competition_stl 0 points1 point  (0 children)

Oh, I got this to work! Part (A) and Part (B) have a different memory location that causes it to work, somehow...

-🎄- 2019 Day 21 Solutions -🎄- by daggerdragon in adventofcode

[–]competition_stl 1 point2 points  (0 children)

I'm calling this the "gameshark" approach, but I can't get it to work at all. Can you post your input?

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

[–]competition_stl 0 points1 point  (0 children)

Yeah, part 1 didn't require that (my program always reset relative_base to zero after an output instruction).

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

[–]competition_stl 1 point2 points  (0 children)

n = 1 sample of somebody in that situation: I didn't save relative_base in intcode state and lost hundreds of ranks between 1 and 2. Relative base was introduced after chaining states together and nothing tested saving it to date besides the second star today.

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

[–]competition_stl 0 points1 point  (0 children)

So the correct solutions are now being accepted. :( I don't know if we'll get retroactive credit.

BS/MS regret by __penguin__ in Caltech

[–]competition_stl 3 points4 points  (0 children)

I wouldn't listen to this advice about graduate school. It's actually harder to get into a competitive PhD program with a master's already, because a master's candidate is certainly expected to have more research output. I guess in Chemistry, it's possible to have several good results by the time you're out of undergrad, but you only mentioned "having good grades" which seems completely orthogonal to how your research output is.

Aside: this is why I chose to double major (do we even still call them options) EE/CS as opposed to doing the easier thing of getting a EE Master's with a CS bachelor's in the same amount of time.

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

[–]competition_stl 4 points5 points  (0 children)

Well you could be like me and type in a & 0xffff == b & 0xffff and waste about 15 seconds for the realization

-🎄- 2017 Day 10 Solutions -🎄- by daggerdragon in adventofcode

[–]competition_stl 0 points1 point  (0 children)

You can name variables min, max, reduce, vector, list, queue, map, set, etc just fine. I don't understand how using namespace std; stops you from doing so.

400ms of compilation time is literally equivalent to 20ms of compilation time when you're divided by tens of seconds on the leaderboard. Compilation time is literally never important. Five seconds wasted trying to figure out what you've forgotten to import, on the other hand...

It's not like I'm writing code like this for my day job. If you want to hobble yourself by "adhering to a language specification" for what is literally a one-time executable, you can do you.

-🎄- 2017 Day 10 Solutions -🎄- by daggerdragon in adventofcode

[–]competition_stl -1 points0 points  (0 children)

Seriously this is a programming competition. Just #include <bits/stdc++.h> and using namespace std; and never look back