« first day (20 days earlier)      last day (1118 days later) » 

03:58
1h
I hope today's is easy
But not for other people
I hope today's is a challenge from here
(I hope both parts are)
04:56
4m
Quiet today
finished showering and brushing my teeth and whatever just like a minute ago
pretty good timing
04:59
glhfaggnbr
@hyper-neutrino *at midnight8
good luck have fun achieve gold get ninjad by redwolf
05:10
well since my part 1 is having massive performance issues and the leaderboard is already fucked for it i guess it's time for a premature start to part 2
844 p1
...my part 1 is also wrong
oh wait nvm
You can guess what p2 is
And I'm kinda stuck on how to do p2 again
05:14
i have a
vague
idea
only 4 people have finished it so far
If python had 3d ranges I'm sure you could run a naive solution with that
i
doubt it
actually i guess?
depending on the implementation
but i doubt it lol
well my code is taking
a while to run
i can imagine
i accidentally ran the joint command in the second window
so it re-ran my test even though i was trying to run them parallel
05:17
@UnrelatedString how do you check this btw
10 now
@emanresuA way too slow imo
Tip: Use regeg
05:19
what?
/(on|off) x=(-?\d+)\.\.(-?\d+),y=(-?\d+)\.\.(-?\d+),z=(-?\d+)\.\.(-?\d+)/
no regex in my language
I just need a way to calculate the intersection of two cuboids...
this is the first time I've written a function taking twelve arguments
uh
i have a really good idea of the general outline of how to do this and a really bad idea of how to implement it
so all of the points inside are off initially right
ok idk why i thought that'd work
3d segtree time
i don't think this is necessary
I had an idea then realised it was O(2^n) where n is the number of instructions...
(Worstcase, it's probably more like O(2^n/2)
my computer is intermittently freezing
i am concerned my program will crash my computer before i get my answer
one of my solutions that i almost went through with is worst case at least exponential but probably bnetter in practice but i'm still not going to do that shit
Actually no
My sol's O(26^n) worstcase
05:29
that's literally the same but also how 26
Oh wait no, O(6^n)
My idea was basically how you'd do this if it was 1d, keeping track of ranges where it's on
O(6^n) is still literally the same as O(2^n) because it's a constant factor but yeah i think you're doing wait no the shit i was thinking of would fucking
divide regions into up to *8* new ones
my p2 solution (pypy) used 4 gb but finished successfully
it's O(n^4) time and O(n^3) memory
@UnrelatedString O(6^n) is strictly worse than O(2^n).
asymptotically
05:33
asymptotically worse
Probably worse than naive approach
wait am i forgetting something
fuck
@btnlq Where n is?
okay wait yeah that's how that works
@emanresuA number of steps
05:38
ah i'm stupid
ok my code will finish within today
k now my code is taking 18 years to sum the thing
4/84
lmfao
Ugh... this is pain
I thought the hard ones were over
lol why
these last few days are like
all hard
ok maybe i wasn't expecting this much on a weekday either
today's problem is actually really good (IMO)
very easy spec that is very challenging and requires some thinking
05:45
yeah it is good
leaderboard closed at 43:54
deceptively not easy
this would be a good one for a video methinks
i also should implement hover spoiler into my library
05:49
the only idea i can think of is just splitting the cube into multiple cuboids
this i have no idea how to implement
That was fun
115/109
so close
aw, so close. good job tho :D
i'm trying a really scuffed intersect everything and offset double counting directly approach but i'm trying it on just the part 1 stuff and it's... slow
@Razetime That's what I started to do but I switched courses midway through
05:51
i did that and then did it a worse way and then did it a third time
all three times were correct the first two were just really fucking slow
and also i was missing three characters that cost me like 5 minutes of debugging
How did you do it in the end?
oh of course i just hit an infinite loop
I'm currently trying to split into sub-regions, is that what y'all are doing?
i was doing that
05:54
@RedwolfPrograms that is how i did it
like quite early on i was like "yeah this is obviously a sparse array problem"
and then failed to do it correctly twice
tjj's approach sounds very interesting tho
Does anyone know if there are there any triple intersecting points?
Here's my solution: github.com/tjjfvi/aoc-2021/blob/main/solutions/2021-22-2.ts (slightly cleaned up)
of course i'm double counting the subtractions now
@RedwolfPrograms Update: There are
I literally have no idea what to do, my current solution is just too slow
I don't wanna just copy tjjfvi's
Wait hang on
I'm an idiot
oh i ended up with
06:02
My approach would've worked
a different way of handling intersecting points between regions
I was just doing it wrong
i just add one to the end coordinate and use half-exclusive
@RedwolfPrograms Wait it wouldn't have
I have literally no idea what to do
Did anyone else use exclusive range on p1 by mistake
That cost me a rank :/
Ugh I don't even know where to start
Two predictions:
- AoC is getting algorithmically tougher every year since 2020
- hyper will get a lot of job offers
3
06:09
:(
I'm so lost
I don't even know where to begin
I don't get why tjjfvi's sol works
Wait, I think I sort of do now?
Ugh, I hate this so much
06:31
I've practically ported tjjfvi's at this point and it's still wrong :/
@Bubbler lmao, i hope
Hang on...my volume is going down over time
That's not supposed to happen
Wait nvm
Wait no it is
06:39
of course my intersection code itself is fundamentally broken
...and i think the fix would have been easier to write in the first plac
e
Wait same
D:
so now i'm only off by 1 on the first example
got it fully working on the first example and was on the verge of saying "wow, i guess the rest of the logic wasn't as shit as i worried" and then i ran the second example with just the stuff in the part 1 zone and it gave me 53012372
Day       Time  Rank  Score       Time  Rank  Score
 22   00:08:27   323      0   01:46:57   979      0
:/
so i was thinking about splitting stuff and I'm worried how i am supposed to hadle having a "off" block in the middle of an "on" block
Today seems like it was way harder for me than for other people and I don't know why that is
06:49
@Razetime you can probably split in each plane
I guess I need to get a more thorough understanding of 3d space
3d in general is a huge pain
@Razetime yeah i just split into 27 blocks like unrelated said
tbh i wish this problem were 2d
3
@hyper-neutrino Wait that works?
06:52
more reasonable execution time/size and much easier to imagine
@RedwolfPrograms yeah
i was thinking more like 8 blocks but that works too
how i do it is
I did 27 then some filtering (so up to 15)
along every x coordinate that exists across all block edges, i cut my space
and same for each axis
so for the real input, i cut my space into uh
about 512 million blocks
which explains why it takes so long to run
it takes about 1 second to update like, 5 or so blocks maybe?
Ohh, so I wasn't doing something wrong
06:53
and then took a solid minute and a half to sum the result
I started to get lots and lots of cuboids, so I just stopped doing it since I figured it was too slow
Well, I'm glad my initial solution would've worked if I'd stuck with it, I feel like the solution I ended up with was more AviFS/tjjfvi's than my own
there is
definitely a smarter way to do it
in fact, i'm 99% sure i already have a much smarter on in mind. do i care enough to go back and implement it? no
although for my library
i am probably building an efficient n-d sparse array utility
Wait would that have worked here?
(No, it seems)
07:00
ok so analyzing my input it looks like none of my given cuboids are completely within each other
07:17
nvm that was wrong
rip
i thought my problem was with how i handle intersections of deleted regions but looks like i'm going way over the result before hitting any deleted regions other than the ones i insert in intersections of added regions
maybe i just want to go back to dividing lmao
man i do not get this problem lol
tjjfvi's solution looks so oddly small
i just do not get it
i still haven't looked at it lol
07:33
oh that is quite small
here's mine, which is also... smaller than i remembered it being github.com/hyper-neutrino/advent-of-code/blob/main/2021/…
...
...i'm going to go backwards
maybe that'll make it make sense
also really fucking slow - @tjjfvi how long did yours take to run
07:48
AOoh just thought of how
i think i may have finally gotten something working by cycling back through every single ting i already tried before reversing it
let's fucking go
that was
an experience
1009/1815 😎
having just committed that abomination reminds me
@emanresuA by the way i did literally talk about writing that
so i'm actually kind of surprised nobody got it lmao
so yeah my approach finally worked when i decided not to try treating off-commands the same as existing intersections by treating them the same as on-commands instead
Oh lol
I'm going to start on p2 now
I don't understand how everyone's works..
I'ma use the division approach with one key difference: remerging
08:04
this Advent of Code was sponsored by Blender™️
someone with blender scripting knowledge has to have made this work
Check the subreddit lol
btw my solution runs in like 3 seconds
@UnrelatedString ...should take 5-6
p1 held me up for ages because I forgot JS flat without args flattens by a single level...
worst case 8 since you could have something completely inside another
No, that's 6
08:10
wait yeah that is 6
i might need food
I've just realised - the only difference between adding an on cuboiud and an off cuboid is that with the on one you return one more cuboide
backwards that is at least
oh yeah or doing the division thing
yeah
fundamentally both have to cancel the intersections
08:32
I've taken apart a rubik's cube to visualise division
the marginal advantage of my having taken a masking approach is i could pretty much just think about 2d
CMQ: Which day has had the biggest difference between p1 and p2?
completion?
i assume proportional if so because otherwise day 3
Difficulty, for you
08:39
day 8
d8 was kinda fun
@Bubbler If hyper gets a lot of job offers, do I get 1 for beating hyper once?
Ooh today's AoC gave me an idea for a challenge which I'll writeup once I'm done
Got division working correctly
with the help of reddit and splitting everything a lot and dying i finished part 2
Guys I think Lyxal hacked AoC again
there are exactly 420 instructions
09:01
Wait @hyper-neutrino how did amending a grid of 2^50 cubes work?!
ok maybe i don't understand your solution propely
Bruh I forgot to use inclusive ranges
@hyper-neutrino oh wow ok, so you're making a 3d grid for all uniques x,y,z values and partitioning that way?
Should I reconstruct a substantial chunk of my code or add some ones and hope it works?
09:08
@Razetime yeah
It's clever and fast to code but slow to run
i wish i thought of that earlier
with 1d it's a pretty standard sparse array
for 3d it's... quite inefficient
i'd need to do it a lot more intelligently
so yours is doing a similar thing to what ngn's is doing as well.
interesting
So, when running my code on one of the samples for p1, I got... 11.6 billioon
For context, the volume of the 101x101x101 cube is 1.03 million
09:22
uhhh
what's going on there
I have no idea :P
p1 shouldn't be that hard but if you're solving for p2 along with it then it gets.. hairy
>The wide range of benefits in pythons has made people choose them for development
Feels like it was written by an AI
for a moment i thought that was your code
> Node.js vs Python before going into the topic, it is better to know what Node.js and Python mean. Of course, in general words, it can also be called a programming language, but people call Python as a language python and Node.js as Node.
yeah i do not understand this
09:49
oh
I'm pushing a duplicate copy of new cuboids for every cuboid it intersects...
VICTORY!!!
1.5s lol
844/2830
10:11
wpwp
mine is very similar lol
Aren't you using BQN?
Or are you just also using the division approach?
yep but BQN can do the same thing as well :)
True lol
Oh wow I see what you mena
10:53
It's a shame github doesn't recognise BQN as a language
oh we are gonna be pushing that hard
 
6 hours later…
16:38
@hyper-neutrino 200ms
damn
maybe i do need to rewrite my solution
 
1 hour later…
18:03
I finally finished (444/6188)
And my approach also took a really long time
 
4 hours later…
22:22
@TheFifthMarshal What was your approach to p2?
(Mine / razetime's / unrelatedstring's was cube division, hyper's was dividing space up into a bunch of chunks based on unique x/y/z coords)

« first day (20 days earlier)      last day (1118 days later) »