« first day (5 days earlier)      last day (1133 days later) » 

01:40
Adám has removed Adám from the list of this room's owners.
 
2 hours later…
03:47
oh
10m
04:55
under 5m
2.5m
Maybe there's an oil spill in the ASCII art
04:58
1.5m
maybe it's a squid tentacle
or bubbles
from the vents
Those have been white so far though
05:01
11/1
52
let's go
nice!
I have a nice 6 byter in vyxal that of course times out for the actual input
Dammit, made a mistake
Now I have to wait 40s
67/139
Not bad
Still on the leaderboard, moved down one place
05:05
i think the sole reason i climbed between points was i only hesistated briefly to copy paste what i already had into the triangular number formula
1011/295
@UnrelatedString Same
I probably would've got top 100 if I hadn't done Math.min(<array>)
...does that do something fucky in js
rip
So I just wildly guessed that the value wouldn't be more than the length of the array * 2
You need to do Math.min(...array), Math.min(array) returns NaN
Which turned out to be fine
05:07
lmao what
@tjjfvi I just guessed 2000
i just used the max value in the input
anyway
that was a massive difficulty drop from the weekend... lol
@tjjfvi I guessed 1000 and it was fine lol
since that's kind of a logical maximum
yeah that was actually insanely easy
05:08
i could've probably ranked higher if i just onelined it
lol
same actually
My original way to calculate the triangle number thingy was with the sum of a range, but it was too slow
coulda just gone for the min(sum(abs(x - i) for i in k) for x in range(min(k), max(k) + 1))
but i was not confident and thought it'd end up too long and messy
but that's actually a really nice looking one-liner
@RedwolfPrograms So I had to use a recursive function since I didn't remember the formula
it really is
05:08
and then for p2 it's trivial to just make a g = lambda x: x * (x + 1) // 2 and throw a g(...) around something in that one-liner
oh well, i really can't be disappointed with my score lol
I'm so happy I've managed to stay on the leaderboard
i sort of stayed away from it worrying that p2 would be a nontrivial extension
I was pretty certain I'd throw today, things've been going suspiciously well for me lol
Is there some non-O(n^2) way of doing part 2?
@hyper-neutrino i almost did that but then i realized it's faster to literally just write abs(n-x)*(abs(n-x)+1)//2
05:09
@TheFifthMarshal You can calculate triangular numbers in constant time
It's just a quadratic
What do triangular numbers have to do with this?
Part 2
That's what the movement cost is
The nth triangular number
@UnrelatedString oh true
it's
05:10
Oh, I independently realized it was 1 + 2 + 3 + 4 + ..., looked up the sum of that sequence on Wikipedia, and didn't realize it was a triangular number.
still O(n ^ 2)
to check every value and then check every value for every convergence point
right?
anyway is anyone else 500ing on personal stats page
Oh, idk. I assumed from the way it was phrased that p1 wasn't also O(n^2) lol
I didn't earlier, lemme check
Yes, I am
05:11
Part 1 can be done in O(n), because the median is always the best convergence point
yeah i think the naive approach we probably all took is O([number of crabs] * [furthest crab position])
wait does that actually work
neat
If I had written a faster way to calculate triangular numbers the first time around, I would've top-100'd on part 2, but I went with the sum of a range >:|
My code (reconstruction): v=[...]; Math.min(...Array(2000).fill(0).map((_,x) => v.map(f => (a = Math.abs(f - v)) * (a+1) / 2)).reduce((a,b) => a+b)))
And I spent a lot of time on Part 2 undoing that optimization, and then wondering whether I needed a different one (because it felt stupid for Part 2 to be less efficient that Part 1)
lol top is already 300 pts ahead sadge
05:13
Ugly butit woorks
oh well, if i can hold my position i already met my goal i set, and maybe i can still climb a few places if i'm lucky
part 2 somehow worked with a cartesian product
@hyper-neutrino You're ahead of Doorknob (at least on private)
huh. interesting
@Razetime ಠ_ಠ how?
05:14
what
right i guess i'm punished less for fucking up yesterday on private than public since tckmn didn't choke i think
y'all already done while I have to figure out how to optimise my solution in a language that does not do speed well
@emanresuA {⊑𝕩/˜(⊢=⌊´)𝕩}•Show +´˘(1+↕⌈´inp)({2÷˜𝕩×𝕩+1}|∘-)⌜inp this is my code, go fish lmao
it's a damn shame i can't check the private leaderboards
05:15
all the leaderboards giving a 500
@hyper-neutrino Wdym?
I have it open right now, I can chek
I've got it cached
if anyone wants to see
may be out of date
it's back now
tbh the most important thing is i am improving (or at least i feel like i am) so even if my score doesn't end up where i want this year i can always keep trying again and keep getting better
which is a better result than the internet points anyway xD
05:17
that's the spirit
always on that sigma male grindset
...i feel like i'm definitely doing worse than last year but i can blame that on finals
totally gonna pop off in a week when i actually have free time
@emanresuA runs instantly
I'm doing times better than last year
05:19
maybe the interpreter is just amazing or i did some optimization without knowing it
these are getting suspiciously easy
maybe it's a setup for a bombshell of a wednesday
lmao
wonder what day the total completion after a day will be less than the part-1-only completion on day 3
@hyper-neutrino Top 10 in the world is seriously impressive even if you weren't steadily improving lol
05:20
^^
^
(Infinite loop go brr)
@RedwolfPrograms true. i do have an issue with always comparing up so i'm never really satisfied, but thanks for the reminder :P
05:27
for reference, my p1 in vyxal: v-ȧv∑g
We have 1-byters for v∑ and
@emanresuA the one byter for doesn't vectorise properly with numbers and lists
Does work?
53 secs ago, by lyxal
@emanresuA the one byter for doesn't vectorise properly with numbers and lists
I just said that it doesn't
Oh. That's... annoying, is there somewhere else we can put it?
05:30
i'll think about it after i finish p2
wait
the cheapest position for part2 is just the mean
or at least on my input
but that must be coincidental
'cause there's no reason that wouldn't be true for part1
> Part 1 can be done in O(n), because the median is always the best convergence point
right
but can anybody confirm on their input if the mean is the cheapest position
@totallyhuman wait no i'm dumb
for part 2
median is true for part 1
05:45
oh wait you were talking about p2
yeah i'm sure that's a lucky coincidence lol
highly doubt that'd work in general tho i cba to prove it :P
for part 1 i mistakenly assumed the input had the answer in it
somehow that worked
@totallyhuman nope
wouldn't have worked
hey look at that it's true for part 2
:P
05:49
p2 in vyxal: Gʀƛ?-ȧ:›*½∑;g
in other news private leaderboards are up and personal stats are disabled
06:07
meanwhile 2020 day 7 was this: adventofcode.com/2020/day/7
i forgot that one was only day 7
that was something
Oh right, day 7s in 2015, 2017, 2018, 2020 all required handling graph structure in some way
2016 d7 was simple and 2019 was intcode (obviously)
what if the last couple easy ones are a setup into a bigger challenge that involves them but you can't brute force it any more
that's it i'm becoming an aoc conspiracy theorist
@UnrelatedString string manip nightmare
i was literally dying in apl
oh i can imagine
06:18
Well, when most of the interesting things are revealed on the very day (esp. in aoc reddit) there's very little point of building up across days
i think i recall the parsing was relatively easy compared to the rest of the logic if not so much the parsing for other problems in my case using python
parsing was frick and doing the rest was also frick
might have been tempted to use regex but i think i just used a bunch of splits or something
O(n) solution for part 2: Try it online!
06:27
(multiline messages do not support markdown)
oh, cool!
so someone wrote an intcode soltuion for today's problem: reddit.com/r/adventofcode/comments/rar7ty/2021_day_7_solutions/…
3
 
9 hours later…
15:40
cc @totallyhuman someone wrote a paper on why the mean works for p2
or specifically, the answer will be extremely close to the mean, so if you take the mean, you only need to check two values
or something like that. maybe i'm reading it wrong
 
1 hour later…
16:56
ooh
but that also means that very smart people found no closed solution for it
 
2 hours later…
19:07
Man, I really need to be at least looking at these at 11
This was another super easy one
Took me 13 minutes
Granted, it's a brute force solution. Although I could speed it up some by starting at a more sensible point

« first day (5 days earlier)      last day (1133 days later) »