[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 1734121746862719.png (25 KB, 1200x1200)
25 KB
25 KB PNG
claw machine edition

>Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other.
https://adventofcode.com/

/g/ leaderboard join code:
796940-44255af5
anonymous-only leaderboard:
383378-dd1e2041

previous thread: >>103503635
>>
File: carbon(57).png (381 KB, 1302x1914)
381 KB
381 KB PNG
first for linear algebra
>>
>>103511653
CUTE!
>>
File: 1733887359530571.png (629 KB, 822x744)
629 KB
629 KB PNG
>my dyscalculic ass who solved it with basic elementary school equation substitution/rearrangement watching people talk about matrix equations and floating point operations and linear algebra

(man am I getting a lot of mileage out of this image this year)
>>
>nintendo added a divider and square root unit to the ARM946E-S they used in the DS
That's practically cheating.
>>
>>103511748
golfed awk solution for today courtesy basic elementary school math
>>
>>103511679
Use linalg solve, it doesn't do slow matrix inversions
>>
File: aoc_2024_13.png (251 KB, 937x3136)
251 KB
251 KB PNG
Perl. All corner cases I could think of, but still assumes that item coordinates are non-negative.
>>
>>103511859
I'm still not sure how to account for multiple solution problems. The naive solving system of equations method just gives you divide by zero errors.
>>
>>103511748
They are mentally retarded, don't worry
They don't know the use cases of inverse matrices if they use them to solve two (2) equations with two (2) unkowns
These are the same people who enter 1+2 into a calculator
>>
>>103511888
>people who enter 1+2 into a calculator
What’s the point? It’s just equivalent to 2+1
>t. Bourbaki
>>
>>103511884
I described it here >>103502576
I wanted to write "dependant" in the first line, so just ignore that part
The function to optimize is linear so its first derivative is constant, just take the minimum or maximum x-es based on the sign of the slope
>>
Hopefully the next challenge is a math day, we haven’t had one yet.
>>
>>103511884
Well, you hardcode special cases like zero vector, and then yes, I just did >>103502576
>>
1 HOUR
>>
>>103511884
>multiple solution problems
that suggests you are looking for the zero crossings of a curve. you may also know these as the roots of a polynomial.
>>
My dad is Eric Wastl and he told me we're getting another cool math problem tonight. He said the fans really love them because it lets them not have to code anything. I asked him what part 2 is and he said it's to do the same thing again but 1000000000 more times so that people can't "program their way out of it". Just wanted to let you guys know.
>>
>>103511977
ty for the update
>>
>>103512045
I heard it is game simulation time from a little birdie ( twitter )
>>
>>103511977
dead thread dead general dead board
>>
>>103512119
and that's a good thing. I come here to hide away from the modern internet with you guys
>>
Today is the real filter
>>
Math is fun. I wish I got to solve math problems more often.
>>
>>103512146
the real world ain't just some math to solve bucko
>>
>>103512146
Crack open a textbook any time you want. Implement your own LA library for fun as you read along. Solve exercises by hand and with your library. The world is your oyster.
>>
>>103512146
Surely you’ve heard of projecteuler.
>>
dijkstra on a hex grid
>>
man im too sleepy for this shit
>>
>>103511792
>golfed
>2-letter variable names
>decorated output
>>
DO NOT PANIC
I have the resources you will need today:
https://www.redblobgames.com/grids/hexagons/
>>
Tonight is a 3d block puzzle. Basically the blocks are falling at different rates, and you have to navigate your way across the falling blocks (you can only cross once it reaches your level). Part2 is the same, but the endings of some blocks contain a jump pack.
>>
i talked to eric and he said this next problem will use teh chinese remainder theorem and Cox-Zucker machines
>>
quick, someone remind me how to use the chinese remainder theorem
if you tell me before it's confirmed to be in the puzzle, then I wasn't filtered
>>
>>103512288
Ok pick a number anon
>>
>>103512298
37
>>
I will never understand the CRT
>>
>>103512304
Ok multiply it by 7
>>
>>103512288
here
>>103503104
>>
File: loli-sunglasses.png (813 KB, 899x899)
813 KB
813 KB PNG
cycle finding today
>>
>>103512305
you never have to
pseuds just like throwing whatever unnecessary over the top algorithm they memorized at everything
>>
We're going in a pyramid today
>>
>>103512310
you were wrong yesterday. lets see if you can redeem yourself
>>
Here's to hoping today is not a generic jeet code puzzle like every other day has been so far this year.
>>
>>103512322
you mean like the last 9 years of AOC?
>>
Tonight is the Geodes problem again.
>>
>>103512322
It will. We're just being delusional
>>
>>103512322
honestly there are only 2-3 good puzzles a year. But they make the whole thing worth it to me.
>>
>>103512249
Ah, I remember reading than in 2017
>>
i feel today will be some water or rock related puzzle
>>
>>103512210
I did the first hundred or so problems many years ago. But that sort of pure math number theory doesn't really do it for me.

>>103512198
I lack direction and motivation for prolonged study.
>>
Today's problem will involve some input parsing, an algorithmic calculation, and outputting a sum.
>>
>>103512288
https://docs.sympy.org/latest/modules/ntheory.html#sympy.ntheory.modular.solve_congruence
>>
>>103512349
you just want to add apples and oranges and shit?
buy a 4th grade math text book
>>
File: dabuchi.jpg (398 KB, 1532x2048)
398 KB
398 KB JPG
TODAY WILL BE THE FIRST HARD DAY OF THE YEAR
it's going to be another "now do it 100,000,000,000 times" problem but it won't be easy like yesterday's
>>
Is there a particular book you'd recommend for linalg, anons? I wasn't able to learn much in HS/college and forgot whatever I did after a decade or so.
>>
File: carbon(9).png (1.92 MB, 1612x1712)
1.92 MB
1.92 MB PNG
forgot to post a cute 2hu yesterday
dont mind the time, i definitely didnt get tripped up by high school algebra

      --------Part 1---------   --------Part 2--------
Day Time Rank Score Time Rank Score
13 00:19:13 1842 0 01:44:13 4896 0
>>
>>103512362
modulo cycle finding today
>>
>>103512210
Higher math is so lame. There's not a single cool aoc-like story you could make around finding subsets of primes that sum to a certain value
>>
10 MINUTES
>>
>>103512384
what if you're breaking encrypted messages in some sort of spy thriller
>>
brootbros...
>>
>>103512391
another day we can seize, trust me
>>
what happened to /our girl/?
>>
> hands status: washed

I am ready
>>
I need to use the toilet, brb
>>
File: 1733201676061642.png (453 KB, 1858x1829)
453 KB
453 KB PNG
>>103512391
im here
>>
>>103512361
I used to be a real engineer and solved differential equations. That was fun. Now I shit out javascript for a living and feel sad about life.
>>
>>103512409
same please wait for me
>>
>>103512328
Nah it only started going downhill in like 2020. Intcode in 2019 was based.
>>
im drinking coffee and i didnt shit earlier
this better not be too tough
>>
Today will be a 3D maze with portals and the topology of a 4d torus, ready your dijkstras
>>
>>103512414
sigh.
same here. but just golang
>>
>>103512426
there will be a heuristic you can use to speed it up so upgrade your dijkstras to A*
>>
>>103512414
>I used to be an engineer
I know you're making it up because it took you this many posts to say it
>>
File: 1723999418790483.jpg (190 KB, 1280x720)
190 KB
190 KB JPG
Tonight's the night!
>>
>>103512426
bruh. thats like day 21/22
>>
>>103512417
i never did 2019, ill need go back and do it since everyone seems to always talk about it
>>
lanternfish 2 today
>>
File: showtime.jpg (46 KB, 640x480)
46 KB
46 KB JPG
https://www.youtube.com/watch?v=hjGZLnja1o8
>>
bros
i think im getting kinda tired of AOC
>>
>>103512444
cancer music
>>
>>103512414
>I used to be a real engineer
There’s still time to learn math.
>>
>>103512444
kino music
>>
weeb music ready
>>
>>103512444
based music
>>
File: file.png (433 KB, 383x681)
433 KB
433 KB PNG
>ass status: unwashed
>solution status: impoorted
>force status: brooted
Showtime.
>>
>>103512444
SHOWTIME
>>
File: mokou-showtime.jpg (130 KB, 440x518)
130 KB
130 KB JPG
>>103512444
>>
>>103512364
https://courses.smp.uq.edu.au/MATH3401/Lectures/1051nosol.pdf Page 71
>>
>>103512442
>everyone seems to always talk about it
No surprise, it's the most divisive and controversial year
>>
>>103512446
just two more week
>>
>>103512458
For this solution, yes, but I was looking for a general book to improve my linear algebra skills.
>>
>>103512364
I liked the 3blue1brown videos
>>
>>103512443
we already had lanternfish 2 this year, retard
>>
File: mokou-computer-tired.jpg (50 KB, 462x605)
50 KB
50 KB JPG
>>
if he redid something like intcode again that would actually stop the LLM fags in their tracks

too bad hes too much of a soiboy and is afraid to alienate newbies and amateurs
>>
>>103512466
steward calculus 6e
>>
brutesisters im scared
>>
ONE TWO SEVEN THREE
>>
>>103512477
I'm gonna make my own AOC.. with blackjack and hookers!
>>
I will brute force today's problem
>>
>>103512477
>too bad hes too much of a soiboy and is afraid to alienate newbies and amateurs
>twoone
>>
Brooters.... ready your cpus.
>>
>>103512349
> I lack direction and motivation for prolonged study.
Same. It is really starting to affect me negatively as any further progression of my skills is starting to require it.
>>
S H O W T I M E
>>
1 MINUTE LEFT
>>
>>103512490
retard
>>
>>103512490
genius
>>
>>103512494
so true
>>
FUCK
>>
FUCK
>>
FUCK
>>
FUCK
>>
good night /aocg/
>>
FUCK
>>
FUCK
>>
FUCK
>>
advent of parsing
>>
>another linear problem
eric...
>>
>What will the safety factor be after exactly 10000000000000 seconds have elapsed?
fuck
>>
it's over
>>
FUCK
>>
>101, 103
dust off that chinese remainder
>>
>>103512539
Fucking hell, I was wondering why those specific values. Primes strike again.
>>
File: clueless-aware.gif (42 KB, 640x640)
42 KB
42 KB GIF
hmmm, I wonder what part 2 will be
>>
when reading the description I thought it would be pathfinding, but this p1 seems relatively easy
>>
I know part 2 is gonna fuck me in the ass but I'm gonna broot part 1 anyway
>>
>ctrl-f hex
>no results
I didn't read the redbubble guide and I won! My bet paid off! I have already passed the filter in my heart!
>>
>part2
What the fuck
>>
ummm? WHAT THE FUCK IS PART 2?
>>
WHAT THE FUCK IS THIS. THIS IS PEAK AOC I AM SORRY ERIC SAMA. I KNEEL
>>
FUCK I DID O(1) SOLUTION FOR NOTHING
>>
does anyone know what the fuck the tree is supposed to look like? all filled in? whats the pattern? jesus christ
>>
OK, I think you're supposed to determine the period of the robots (if any) and then use that to look for the easter egg.
>>
>forgot to change size for the real input
a tale as old as AoC
>>
part 2
what the fuck
>>
WHAT THE FUCK
>>
interesting part 2
      -------Part 1--------   -------Part 2--------
Day Time Rank Score Time Rank Score
14 00:14:52 1276 0 00:23:21 320 0
>>
File: xarbon.png (17 KB, 524x788)
17 KB
17 KB PNG
      -------Part 1--------   -------Part 2--------
Day Time Rank Score Time Rank Score
14 00:13:34 1094 0 00:23:33 332 0

unwashed ass
>>
>part 2
oh this is gonna be fun
>>
File: erect.png (436 KB, 600x667)
436 KB
436 KB PNG
      -------Part 1--------   -------Part 2--------
Day Time Rank Score Time Rank Score
14 00:08:15 416 0 00:25:20 425 0


I am... NOT FILTERED BABY LET'S FUCKING GOOOOOOOOOOOOOOOOO
>>
so... is the christmas tree very obvious? i'm just going through breakpoints like a jackass here
>>
yay just finished, rank around 500
>>
File: file.png (27 KB, 792x765)
27 KB
27 KB PNG
oh im disappointed by how easy it is
to any anons scratching their head
not all the robots are used to make it
>>
File: miku-christmas.jpg (345 KB, 928x1232)
345 KB
345 KB JPG
>>103512721
it's very obvious
>>
i got filtered a few days ago now but i'm sticking around to watch you guys freak out when it's your turn to get filtered :)
>>
>>103512721
heres a tip
if any two robots overlap dont bother breakpointing
>>
made a quick battlefield meme
>>
>part 2
wut
>>
File: UNWASHED ASS.png (301 KB, 732x2364)
301 KB
301 KB PNG
>>103512714
I eyeballed my output to solve it, but here's an UNWASHED ASS that gets me the solution also.
>>
puzzle done, time to make like a historian and take a dump
>>
this puzzle is such an obvious fuck you to all the LLM fags holy shit

      --------Part 1---------   --------Part 2--------
Day Time Rank Score Time Rank Score
14 00:10:54 700 0 00:26:54 526 0
>>
>>103512725
oh I thought it would be a triangle and so solvable programmatically without looking at it. This makes it easier tho
>>
>very rarely, most of the robots should arrange themselves into a picture of a Christmas tree.

WHAT??
>>
tried to think ahead and p2 requires a complete rewrite
>>
Built an animation, looking for trees....
>>
>>103512745
Someone please translate this to English so I can understand it.
>>
File: carlos2.jpg (5 KB, 209x241)
5 KB
5 KB JPG
This day proves that brootchads reign supreme.
>Verfication not required.
>>
File: img-2024-12-14-06-32-08.png (314 KB, 1410x2504)
314 KB
314 KB PNG
unidiomatic Rust solution
>>
>>103512735
ok yeah that worked
how the hell did people guess this shit
>>
>>103512759
"This puzzle was created to be difficult to solve when using AIs like ChatGPT or Claude."
>>
File: file.png (40 KB, 624x207)
40 KB
40 KB PNG
HOW
>>
>>103512766
Thanks for the translation.
Yes, I agree.
>>
>>103512771
In high level online chess tournaments, they make you stream your own play, with one camera on you and another on your monitor. I think they should do the same thing for AoC. Don't want to stream? That's fine, you're just not eligible for the global leaderboard.
>>
i want to ask questions about other anons input but if i ask what im about to ask i feel like a bunch of people who got filtered would become unfiltered...
>>
File: file.png (18 KB, 732x946)
18 KB
18 KB PNG
still printing...
>>
>>103512779
https://github.com/DuroCodes/advent-of-code/commit/28961c1b3338ee5da2da10b1fb37db8c6586576a
This is his solution. I'd like to ask how he came up with robot_density of all things.
>>
wat
>>
Part 1
data = open("Day 14 input.txt", "r").read().strip().replace("p=", "").replace("v=","").replace(",", " ").split("\n")

#size = [11,7]
size = [101,103]
grid = [[0 for i in range(size[0])] for j in range(size[1])]

quads = [0,0,0,0]
for i in data:
x, y, dx, dy = map(int, i.split())
x += dx*100
x %= size[0]
y += dy*100
y %= size[1]
print x, y
grid[y][x] += 1
if x < size[0]/2:
if y < size[1]/2: quads[0] += 1
elif y > size[1]/2: quads[2] += 1
elif x > size[0]/2:
if y < size[1]/2: quads[1] += 1
elif y > size[1]/2: quads[3] += 1

for line in grid: print line
print quads
total = 1
for i in quads: total *= i
print total

Part 2
data = open("Day 14 input.txt", "r").read().strip().replace("p=", "").replace("v=","").replace(",", " ").split("\n")

#size = [11,7]
size = [101,103]
grid = [[0 for i in range(size[0])] for j in range(size[1])]

nums = []
for i in data:
nums.append(map(int, i.split()))

loops = 0
while True:
loops += 1
seen = set()
for i in nums:
i[0] += i[2]
i[1] += i[3]
i[0] %= size[0]
i[1] %= size[1]
seen.add((i[0], i[1]))
if len(seen) == len(nums):
print("ASDF")
break

print loops

Took a shot in the dark that the final image had a certain property, and it paid off.
>>
is the answer high for p2? I printed all 100 secs and nothing
>>
>>103512801
There's no limit for part 2 anon.
>>
>>103512725
im trying to figure out if the position of the tree is consistent for everyone
the top left/bot right coord's of the square for me are:
x=21 y=39
x=41 y=71

Anyone confirm?
>>
>>103512735
thats some bullshit
>>
>>103512801
Mine was in the 7000 range. Follow what this guy said >>103512735
>>
>>103512817
maybe my input was luckier than yours but i got an answer after 2 breakpoints using that
>>
Someone explain P2 to me, how exactly does all the robots being in unique positions mean they are in a Christmas tree?
>>
>>103512801
Small enough to not need any math trickery, but you'll probably be waiting quite a while if you do it manually
>>
File: file.png (837 B, 63x49)
837 B
837 B PNG
Look guise, it's a little comet! :D
>>
>>103512827
Classic Eric asspull. It's nice in that it filters LLMfags though.
>>
>my answer doesn't work
>spend 25 minutes trying to figure out why
>end up with the same answer
>try it again
>it works
I must have pasted something else...
>>
File: angry-asuka.jpg (58 KB, 720x547)
58 KB
58 KB JPG
how does a crismas tree look like?? i don't fucking see one.
>>
fellow brooters, Keep your eyes peeled. The tree will flash by any moment now
>>
>>103512842
>>103512725
Like ^. If you're doing it manually, it can take thousands upon thousands of iterations if your input is unlucky
>>
ADVENT OF MANUAL PARSING
I'm getting filtered
>>
File: carbon.png (507 KB, 1478x2508)
507 KB
507 KB PNG
      --------Part 1--------   --------Part 2--------
Day Time Rank Score Time Rank Score
14 00:18:37 1807 0 00:32:18 864 0

Unwashed.
At first I thought the tree would have empty corners but it seems to have random robots flying around. Then I also checked if the center has robots, but my tree is slightly to the right... Then I just searched for a couple # in a row in the output and easily found it.
>>
I CANT FUCKING FIND IT
>>
>>103512793
print only if the buffer contains ########
>>
File: image.png (2 KB, 245x534)
2 KB
2 KB PNG
is this a crismas tree??

>That's not the right answer
>>
>>103512864
I have a solution looking for this and its been running for 10 minutes (its like n^4 dont judge me)
>>
>>103512842
>>
>>103512868
are you retarded anon
>>
>>103512877
What the fuck, why is it sideways?
>>
File: 1717358605875882.png (35 KB, 713x1061)
35 KB
35 KB PNG
>>103512882
mine is too
>>
>>103512877
tell me the coords of the square please?
>>103512807
>>
>>103512882
>>103512887
did you forget to swap x and y
>>
>>103512872
it shouldn't
>>
>Printed out first 10k Trees
BROOTERS WE WON I FOUND IT
>>
File: 1722833556365381.png (55 KB, 473x1163)
55 KB
55 KB PNG
not pretty but best p2 time yet with 1853 rank
>>
File: day14clojure.png (718 KB, 849x689)
718 KB
718 KB PNG
today was fun again at least
>>
https://pastebin.com/SYFRHtt5
if you use this input for part 2, do you get 7050? That's where I'm finding my first tree but apparently that's the wrong answer
>>
BROOTERS
I KNEEL
>>
File: 1730675253896899.png (412 KB, 1662x2320)
412 KB
412 KB PNG
This was certainly something, Eric, I kneel.
>>
>>103512908
off by 1
>>
>>103512908
7051
>>
>>103512908
off by 1
>>
>>103512908
You did the exact mistake I did anon, gz.
>>
>>103512807
(38,24) and (68,56) for me.
>>
>>103512908
that'll be a $150,000 fine for ip theft
start hiding your cash anon
>>
>30 minutes of troubleshooting
I was dropping negatives
>>
>>103512932
yeah im trying >>103512908
and it seems its random for everyone
which makes a general solution really fucking annoying to implement
>>
How the FUCK do I detect a fucking christmas tree?
>>
Does the tree have literally anything at all to do with the quadrants?
>>
>>103512939
no
>>
File: 10403.png (532 B, 101x103)
532 B
532 B PNG
well, that's a tree alright
>>
File: cypheraoc.jpg (469 KB, 1600x835)
469 KB
469 KB JPG
I don't even see the code. I just see christmas tree, elf, santa...
>>
>>103512938
irrelevant
>>
>>103512765
Easiest condition I could think of to check
My next guess would probably have been to check if a lot of bots were adjacent but "put all the bots in a set, check the length of the set" was like two lines of code
In hindsight it makes sense, to generate the input you would start with the picture and then run a lot of turns backwards, so you'd have to go out of your way to insert double coordinates in the original picture
>>
File: Day 14-2.webm (99 KB, 404x412)
99 KB
99 KB WEBM
Blink and you'll miss it
>>
File: 1732728589543934.jpg (250 KB, 1024x1024)
250 KB
250 KB JPG
not quite what I meant by robots standing in a christmas tree shape
>>
I don't care if this puzzle was "bad" for being underdefined as shit, it's soulful
>>
File: d14.png (218 KB, 960x2440)
218 KB
218 KB PNG
I'm gonna broot and you can't stop me.
>>
>>103512944
Why oh why did I take the red and green pill?
>>
>>103512950
>My next guess would probably have been to check if a lot of bots were adjacent but "put all the bots in a set, check the length of the set" was like two lines of code
thats what i did to start with but it didnt work as he put random shit all over the place
>>
>>103512951
Christmas tree jumpscare
>>
>>103512951
>snow
>snow
>snow
>tree
>snow
>>
it's over for GBA anon, too many sim steps combined with high tree offset and convoluted checking scheme
>>
File: shoot_2024-12-14_00:57:27.png (300 KB, 1137x2121)
300 KB
300 KB PNG
oh heres my """"solution""""" i guess
I printed my first 10k trees to a file and then just
/#######
in vim

TOTAL BROOTER VICTORY
>>
>>103512957
Could've counted how many bots have direct neighbors and whenever that count hits a new record you print
>>
this puzzle is bullshit for folx who rely on screen readers, i thought eric already learned this lesson!?!
>>
>>103512980
yeah that probably would have been sensible
oh well
>>
>>103512938
it should look like this somewhere in the grid
###############################
# #
# #
# #
# #
# # #
# ### #
# ##### #
# ####### #
# ######### #
# ##### #
# ####### #
# ######### #
# ########### #
# ############# #
# ######### #
# ########### #
# ############# #
# ############### #
# ################# #
# ############# #
# ############### #
# ################# #
# ################### #
# ##################### #
# ### #
# ### #
# ### #
# #
# #
# #
# #
###############################
>>
>>103512976
hi, good thing you didn't read from stdin, because that's cheating amirite?
>>
>>103512951
Also at this speed, if it was from the beginning you'd have to be staring nonstop for ~12 minutes for a chance to see it
>>
>mfw i spent 10 mins looking at the first 500 outputs manually
>>
>>103513002
I don't get it
>>
I hope some chad generates a video, trains and uses an ML model to detect the tree. The only acceptable use of AI for AOC.
>>
>>103512955
Holy shit, I just looked at my tree now and the lengths of the diagonals are 5.
It doesn't look like the diagonals actually matter because there is a box that would have triggered my checker anyway because the vertical lines are really long, but I'm just surprised that I got something that would detect the tree first try.
>>
>>103512998
Umm, do you have permission for that art? Expect a lawsuit in the coming days, sweaty.
>>
>>103512998
Yeah, I already read the thread, so I just detected straight lines > 10, but how the fuck should I have guess it?
>>
>>103512973
Day 13 is probably beyond me anyway unless you can think up a solution that doesn't involve division (and will complete within the life of two AA batteries).
>>
>>103513024
some people just arent built for the global leaderboards
>>
>>103513009
This guy thinks that reading from stdin is cheating, he claimed that in an older thread.
>>
>>103513024
Easy, you only print the maps where you detect a suspicious amount of straight lines and then stare at them. Took me a while, but it was done.
>>
>>103512938
>>103512998
lmao I too couldn't be bothered to decipher what he meant by a chistmas tree so I am shamelessly cheating for this part2.
If asked for the simulation step where 10 robots are contiguously aligned OK, but a christmas tree? aint nobody got time fo that
>>
this was a bit annoying.
>>
>>103513041
I can draw a fucking christmas tree without a single straight line. This is a bullshit question.
>>
File: file.png (16 KB, 613x1072)
16 KB
16 KB PNG
Guess it's time to detect the tree properly, not just "first without overlapping robots is a tree"
>>
>advent of ctrl-f
>>
File: carbon.png (212 KB, 1324x1346)
212 KB
212 KB PNG
      -------Part 1--------   -------Part 2--------
Day Time Rank Score Time Rank Score
14 00:23:28 2548 0 00:36:40 1144 0


>>103512827
It's an artifact of how the puzzle inputs were generated. Eric obviously made a little Christmas tree, applied a random velocity to every coordinate, and then ticked everything a few thousand times. The input is the final coordinate + the inverse of the velocity he applied. Ergo, no overlapping robots.
>>
>>103513052
Then do diagonal lines instead.
Or do an area fill of connected bots and print if you get more than 15 forming a polygon.
>>
The velocities are coprime with the width/height so all robots have a period of width * height. Make with that information what you will.
>>
>>103513028
instead of dividing the equations, you can subtract one from the other. (aka. row elimination). I think if you are clever you can get away with only multiplication,subtraction, and addition.
>>
File: carbon.png (420 KB, 1668x1992)
420 KB
420 KB PNG
The intended solution is to use the idea of quadrants for image detection.
>>
>>103513071
I have no idea what you are talking about.
>>
>>103512973
Nah, should be doable. Only a few thousand steps, and just checking for overlaps.
>>103513028
>doesn't involve division
It can be solved with integer division (everything with integers for that matter), is that too hard to implement? It's only a handful of calculations per machine so I'd be surprised if it took longer than the batteries would last
>>
>>103513068
I can draw a sparse christmas tree.
>>
Is the answer for part 2 guaranteed to be the first iteration where there are no overlapping robots, or did I just get a lucky input?
>>
File: Day 14-2.gif (482 KB, 404x412)
482 KB
482 KB GIF
>>103512951
indeed
>>
>>103512827
>>103513064
If you mean no overlaps between robots, they also reach that position around 1500 iterations for me.
>>
>>103513078
If you simulate a robot 10403 times it will end up in the same position.
>>
File: .png (1.23 MB, 1113x977)
1.23 MB
1.23 MB PNG
it's a new import day
>>
      --------Part 1--------   --------Part 2--------
Day Time Rank Score Time Rank Score
14 00:37:33 4315 0 01:11:46 3445 0

sight what a fuckup.
unwashed part2.
    xmax := 101
ymax := 103
secs := 10000


for step := range secs + 1 {
newpos := make(map[xy]int, 0)
nlist := make([]pv, 0, len(rlist))
fmt.Println("step", step)
for _, rob := range rlist {
nx := rob.p.x + (rob.v.x)
nx = nx % xmax
if nx < 0 {
nx = xmax + nx
}
ny := rob.p.y + (rob.v.y)
ny = ny % ymax
if ny < 0 {
ny = ymax + ny
}
npos := xy{nx, ny}

newpos[npos]++

nlist = append(nlist, pv{npos, rob.v})
}
prints := false
for y := range ymax {
for x := 0; x <= xmax; x++ {
oks := 0

if _, ok := newpos[xy{x, y}]; ok {
oks++
for xi := x + 1; xi <= xmax; xi++ {
if _, ok := newpos[xy{xi, y}]; ok {
oks++
} else {
break
}
}
}
if oks > 20 {
prints = true
}
oks = 0
}
}
if prints {
for y := range ymax {
for x := range xmax {
if l, ok := newpos[xy{x, y}]; ok {
fmt.Printf("%d", l)
} else {
fmt.Print(".")
}
}
fmt.Print("\n")
}

time.Sleep(time.Millisecond * 3000)

}
rlist = nlist
}


// c1, c2, c3, c4 := 0, 0, 0, 0
// midx := (xmax) / 2
// midy := (ymax) / 2
// fmt.Println("midx,midy", midx, midy)
// for pos, count := range newpos {
//
// if pos.x < midx && pos.y < midy {
// c1 += count
// }
// if pos.x > midx && pos.y < midy {
// c2 += count
// }
// if pos.x < midx && pos.y > midy {
// c3 += count
// }
// if pos.x > midx && pos.y > midy {
// c4 += count
// }
//
// }
// fmt.Println(c1, c2, c3, c4)
//
// sum := c1 * c2 * c3 * c4
// fmt.Println("sum", sum)


part1 at the bottom.
>>
File: 1703507310539395.png (458 KB, 1678x1719)
458 KB
458 KB PNG
I guessed that the bots would all be part of the pattern (turns out that's wrong lol), so I just iterated until I found a time where all bot positions are unique and that worked.
Does that work for every input, or did I get lucky? Since only comparatively few robots are outside the pattern, there's still only a moderate chance that two are on top of each other even if it's random (birthday problem).

Fun day, blind people btfo.
>>
>>103513081
Works for my input as well.
First step where I dont have 2 robots in the same pos is a tree
>>
OK, now for the real talk.
I bruteforced part 2 by generating pics and scrolling through the folder icons.
How in the hell one should even know about the exact Christmas tree shape to find it programmatically?
It can be solid, it can be hollow, it can have a clear outline, it can have gaps, it can be an "icon", it can be "realistic", etc.
This problem is easier to solve by a Computer Vision model than by honest coding.

Oh, and every solution searching for the "#############" border is blatant cheating - you couldn't possibly know this if you didn't look at what the others are doing.
>>
I was expecting I would have to memoize the positions, find some repeating pattern and then calculate that out to some big number of seconds, but instead it was just an easy loop.
>>
>>103513120
I wasnt searching for the border, I was just trying to find any blob in my 100k line output
>>
so confirmed the people on the part2 leader board is non llm users?
>>
>>103513120
I thought the tree would have some diagonal straight lines and some vertical straight lines.
So I picked an arbitrary length and looked for them each second.
>>
>>103513120
>Oh, and every solution searching for the "#############" border is blatant cheating - you couldn't possibly know this if you didn't look at what the others are doing.
I Ctrl+F'd my own output nigger. You don't have to post your first solution.
>>
>>103513120
Nigger I was the first doing this just verically and I was the first who submitted code in this thread, no images or code were posted before >>103512707
>>
>>103513120
I assumed that a christmas tree would be easily parsable, and that was going to be the case if there were a bunch of robots in a row.
>>
I like the intention behind today's puzzle, but he could be more specific (e.g. provide a reference drawing).
>>
>>103513120
>attempt to compress the image
>a neatly ordered image will compress better than the random static it otherwise is
>whichever one compresses best is probably the answer
There you have it
>>
>>103513120
I didn't even know there was going to be a border and still guessed that a tree would have "#####...". You're pretty dumb.
>>
>>103513151
No, fuck references.
>Btw, there is a Christmas tree somewhere in there, go find it.
This was peak.
>>
>>103513169
eric really redeemed himself today after nearly 2 weeks of snoozefest puzzles.
>>
this puzzle today was NOT blind friendly!
>>
>>103513008
I just recognized the pattern, starting at t=77 after every 101 (= WIDTH) ticks I'd get something that kind of looked like a tree. That made the search much faster.
>>
>>103513151
I liked it more because I had to find out what a tree fucking looks like in eric's twisted mind
>>
>>103513177
kek I remember this seethe from the folding puzzle
>>
>>103513169
This is an advent of code, not advent of reading Eric's mind. How the fuck would I know how he would draw a christmas tree?
>>
LLMs absolutely BTFO today
>>
>>103512868
>>
>commit solution
>github is in awe of my brooting
lmao
>>
most annoying puzzle in aoc history maybe ever.
worse than the one that printed the solution as ascii art in a grid.
>>
File: 1725517680904142.png (2.36 MB, 1000x3126)
2.36 MB
2.36 MB PNG
medium washed
>>
Certified Kino Day
>>
Most sovlful puzzle in aoc history maybe ever.
not quite as sovlful as the one that printed the solution as ascii art in a grid though.
>>
Pros
>The puzzle BTFO'd LLMs
Cons
>The puzzle featured the Eric Bullshit Classic™ (solution is much easier to find if you assume a hidden property of your input, even though it makes your code broken for other inputs)
>>
>>103513216
Both are top tier
>>
Um bros? Where is bikatrnigger on today's leaderboard?
>>
>>103513236
>this picture probably has adjacent robots
>"""""hidden"""""" property
>>
>>103513249
>reading comprehension
E.S.L.
>>
>>103513120
the heuristic I used is whether or not more than 70% of robots are adjacent to other robots
>>
>>103513024
i placed pretty well, all i did was dump every state to a file and scroll through them
i (and i assume everyone) have a cycle of ~10k, it's doable
>>
>>103513247
https://kadenbilyeu.com/blog/5880f995-6852-4f0b-83ba-8931ef7dcb76
>>
i think programmatic way to do it would be a heatmap solution, calculating the mean dispersal along the way and stopping when a large deviation is found, but I haven't checked to see if there are large coalitions of robots along the ay that don't form into a tree
>>
>>103513249
There is a much more bullshit hidden property that got me on the leaderboard
>>
>>103513249
the hidden property is that the Christmas Tree iteration has no overlapping robots
>>
>>103513024
I guessed it, it was obvious and you're retarded.
>>
>>103513120
I unashamedly cheated (searching for a straight line of robots as heurstic)
I've never even seen a Christmas tree, what do you take me for? A Kaffir!?
Begone infidel, lest you taste my shoe
[spoiler]Eric should have at least shown us what it would look like imho[/spoiler]
>>
>>103513260
is it some lcm chinese remainder bullshit? I was going to start randomly multiplying velocities together if it wasnt in the first 10k
>>
>>103513265
It's that none of the robots overlap.
>>
File: 24_D14_C#.png (572 KB, 2322x2754)
572 KB
572 KB PNG
>3400+ plots in
>just realized I was using the sample set the whole time
FUCK
>>
File: day14mp4.webm (1.03 MB, 500x500)
1.03 MB
1.03 MB WEBM
animation of my gay video inspector... zoom... enhance!
>>
>>103513262
>>103513270
oh that sort of makes sense in hindsight, but I would have never thought of it.
>>
>>103513278
It actually doesn't make sense. It only works because Eric hand-crafted the input to have that property.
>>
>>103512832
I liked the little comet, do you know if it’s a reference to one of the past year stories?
>>
>>103513273
Beautiful
>>
File: carbon(10).png (1.77 MB, 1556x2944)
1.77 MB
1.77 MB PNG
>>103512745
feeling pretty good about today considering i ate shit on basic algebra yesterday
>>
>>103513284
well the inputs were obviously made starting with the tree and giving the robots random velocities. But I agree that the answer could easily have overlapping robots. But in most scenarios except for the most edge of edge cases, the number of overlapping robots would at least be at a local minimum.
>>
>>103513090
Same, there are 2 states with no overlaps at 1286 and 3541 for me.

Gonna guess it's related to the birthday paradox, where it's highly unlikely that every single robot "randomly" land on different coordinates except from the starting state the inputs were generated from.
If we plug all the numbers into the birthday paradox formula and throw that shit in a python interpreter
>>> # chance of no overlaps
>>> (10402/10403)**(500*(500-1)/2)
6.191646270216072e-06
>>> # percent of no overlaps
>>> (10402/10403)**(500*(500-1)/2) * 100
0.0006191646270216072
>>> # meaning there should be a state with no overlaps about 1 in every this many states
>>> 1 / ((10402/10403)**(500*(500-1)/2) * 100)
1615.0793445845584

Yeah that looks about right
>>
File: carbon(138).png (939 KB, 1276x6850)
939 KB
939 KB PNG
retarded risc-v
>>
>>103513265
>lcm chinese remainder bullshit
This is actually how I solved it. I looked at the t=x mod 103 for different x, until one of them looked like it had a pattern of some kind
>>
File: carbon (16).png (169 KB, 952x1847)
169 KB
169 KB PNG
Very fun puzzle this time. Unwashed python
>>
>>103513299
>in most scenarios except for the most edge of edge cases, the number of overlapping robots would at least be at a local minimum
He could've drawn a tiny tree with tons of overlapping robots. Would've been pretty funny
>>
>>103513302
I assume he generated his input starting from a bmp of the tree plus noise, and that’s how it got this way
>>
File: carbon(58).png (481 KB, 1606x2508)
481 KB
481 KB PNG
At roughly 1:20 I noticed that I had hardcoded the step function to 100 instead of using its parameter. In that time I had rewritten the detection function three times using three different methods. My first method gave me the right answer.

      --------Part 1--------   --------Part 2--------
Day Time Rank Score Time Rank Score
14 00:11:14 738 0 01:28:56 4326 0
>>
>>103513312
I was going to do it that way, but I always forget how crt works. plus my broot finished while I was screwing around with it and I was able to find the tree in the text dump.
>>
>>103513327
I actually initially assumed this, but my search for large overlaps didnt work.
>>
>>103513315
this was a really good day to make use of classes
>>
>>103513258
kek.
Wait. So the days when the LLMs starting to BTFO he lost leader board spots and now feels "burnt out".
good one.
remember grifters like this are successful in the end because there are more suckers than people questioning it. He will be successful and land a job 5x your current pay.
>>
>density of robots vertically at intervals of 103
>density of robots horizontally at intervals of 101
what does this mean? will the image just be the intersection?
>>
>>103513258
LMAOOOOOOO
Eric is so based for this
>>
Nice
>>
>>103513368
its primes so that the robots movement is coprime and they move in a longer cycle
>>
Post your tree timestamp
7672
>>
>>103513401
6888
>>
>>103513401
>help unfilter anons
I don't think so. Nobody should have posted the tree shape itt btw.
>>
File: 1719360803900552.png (322 KB, 1448x780)
322 KB
322 KB PNG
>import solution
>>
>>103513368
>>103513389
there's a game called veggie quest that has some really nasty puzzles dealing with coprimes and the cycles they form
>>
File: bqn.png (137 KB, 831x1167)
137 KB
137 KB PNG
first day I solved from the beginning in BQN
part1 was fine though I blew a lot of time using ToNats on negative inputs.
but for part2 I was screwed. I have an awkward draw that loops over the entire range of pixels and checks if a robot at that position
Sus was just guessing and tuning until I finally found something, looking for >20 inline x or y pixels
>>
File: leo-pointing.jpg (119 KB, 2000x1000)
119 KB
119 KB JPG
>>
File: day14.png (47 KB, 691x899)
47 KB
47 KB PNG
BQN day 14

I was lucky and my answer for part 2 was the first iteration with no overlaps but I added the tree check after for the sake of correctness.
>>
File: patterns.png (3 KB, 1244x412)
3 KB
3 KB PNG
>bruteforced today by looking at pictures of all possible combinations
Looking at all the images I noticed that there were two distinct patterns that kept happening, a horizontal one and a vertical one and they were both occurring closer to each other until they finally lined up and made the tree at 8258
Was the intended solution to figure out when the horizontal and vertical patterns occurred and when they would first overlap?
>>
>>103513480
>Was the intended solution to figure out when the horizontal and vertical patterns occurred and when they would first overlap?
Probably not.
>>
>>103513120 No need for computer vision, Sir.

General solution for part 2 using image entropy
>>
File: Untitled.jpg (59 KB, 598x417)
59 KB
59 KB JPG
dont blink
>>
>>103513477
yup, multiple people has reported the same. first non overlapping robots is the image. (me too)
>>
>>103513480
whats the green/blue dots for?
>>
How long does it go before it cycles?
Tried calculating it and got a number with an insane number of digits, so I'm wondering if I fucked up the math.
>>
File: carbon (6).png (471 KB, 1818x2364)
471 KB
471 KB PNG
>>
>>103513549
cycle? We are looking for trees.
and like <10k
>>
>>103513549
this is how i check it >>103513550
for my input at around 10500
>>
File: 1704698394724855.png (244 KB, 1180x2786)
244 KB
244 KB PNG
Spent two hours trying to find various shapes with convolution and looking at the output manually before I realized I was using a velocity instead of a position to update the grid
I was going to implement Moran's I because I thought I must be missing it
>>
>>103513259
Ok I implemented a solution for this and it worked. If you calculate all the distances between each robot after each iteration and get the mean, there is a large discrepancy between the average mean and the final image result. My array of means sorted by lowest values looked like this:

5th lowest: Loop 4198, avg distance = 52.37432294307491
4th lowest: Loop 387, avg distance = 52.37280987678167
3rd: 1108, 52.23846890568285
2nd: 1829, 52.116023211080794
1st (Answer): 6876, 39.52101793949345

Only issue is this took 3 minutes to run because calculating the distances is nlogn for each 6k iterations. I tried putting them in batches of 50, 100, 250 however this caused the mean discrepancies to not be so obvious, making setting a fault tolerance more difficult.
>>
>>103513538
multiple robots in the same space, blue for two and green for three
>>
>>103513562
cool
>>
>>103513562
why not just calculate the mean distance to the nearest robot instead?
>>
>>103513582
thats a good idea, ill try that
>>
>>103513562
i took a slice of half the columns at every offset then printed the image if the number of bots in that slice multiplied by 1.5 was greater than the total
>>
>>103513549
101*103 because both are prime
>>
>>103513401
>>103513410
sorry, eric owns the copyright to those numbers
>>
good puzzle eric, for once
>>
For me, multiplying the safety factors together produces a maximum within a few cycles of the answer.
>>
File: file.png (844 KB, 1829x762)
844 KB
844 KB PNG
>https://www.youtube.com/watch?v=IbzlX43ykxQ
thread theme
>>
File: xarbon.png (13 KB, 604x596)
13 KB
13 KB PNG
>>103512707
washed ass
$ ./main < inp.txt 
+ ulimit -s unlimited
+ pypy main.py
+ tee /dev/fd/63
++ tail -n 1
++ xclip -sel clip
218619324 6446

real 0m0,396s
user 0m0,380s
sys 0m0,017s
>>
>>103513610
spoilers much?!
I have not watched that movie yet.
>>
for me, for each second, I checked if there existed a robot that had adjacent robots in all 8 directions, then printed the map
the first time it happened resulted in the tree
>>
I think the leader board would like different is Eric said:
Now find the corrupted CEO
>>
do you guys also get 9287 for this? http://0x0.st/XFQI.txt
>>
File: D14.png (36 KB, 1080x1880)
36 KB
36 KB PNG
>>103513368
Like I expected the image ended up being where the two sequences had the same value. It feels like there's some algorithm I could have used to find where that would've been, but I'm too much of a brainlet to figure it out.
>>
>>103513645
9287
capacha:
YWNBAW
>>
FUCK
import { createCanvas } from "canvas";
import { readFileSync, writeFileSync } from "fs";

const input = readFileSync("./input", "utf-8").trim().split("\n");
const HEIGHT = 103;
const WIDTH = 101;

const robots = input.map((line) => {
const [_, x, y, vx, vy] = line.match(/p=(.*),(.*) v=(.*),(.*)/).map(Number);
return {
x,
y,
vx,
vy,
};
});

const robotsAt = (time) =>
robots.map(({ x, y, vx, vy }) => ({
x: (((x + time * vx) % WIDTH) + WIDTH) % WIDTH,
y: (((y + time * vy) % HEIGHT) + HEIGHT) % HEIGHT,
}));

const robotsGrid = (robotsAt) => {
const grid = Array.from({ length: WIDTH }, () =>
Array.from({ length: HEIGHT }, () => false),
);
robotsAt.forEach(({ x, y }) => {
grid[x][y] = true;
});
return grid;
};

const IMAGE_WIDTH = 100;
const IMAGE_HEIGHT = 100;
const image = createCanvas(IMAGE_WIDTH * WIDTH, IMAGE_HEIGHT * HEIGHT);
const ctx = image.getContext("2d");
for (let time = 0; time < IMAGE_WIDTH * IMAGE_HEIGHT; time++) {
const robotsAtTime = robotsAt(time);
const grid = robotsGrid(robotsAtTime);
const originX = (time % IMAGE_WIDTH) * WIDTH;
const originY = Math.floor(time / IMAGE_WIDTH) * HEIGHT;
for (let x = 0; x < WIDTH; x++) {
for (let y = 0; y < HEIGHT; y++) {
ctx.fillStyle = grid[x][y] ? "#FFFFFF" : "#000000";
ctx.fillRect(originX + x, originY + y, 1, 1);
}
}
ctx.fillStyle = "#FFFFFF";
ctx.font = "30px Arial";
ctx.fillText(time.toString(), originX, originY + 30);
}
writeFileSync("output.png", image.toBuffer());
>>
>>103513653
haha wtf. You tree is chopped down.
>>
File: ywnbaw.png (11 KB, 507x855)
11 KB
11 KB PNG
>>103513645
fucking kek
>>
>>103513668
hmmm, that's not a x-mas tree. Keep going.
>>
>>103513645
Lmao don't let rust idiot see this
>>
>>103513655
Fixed
import { createCanvas } from "canvas";
import { readFileSync, writeFileSync } from "fs";
const input = readFileSync("./input", "utf-8").trim().split("\n");
const HEIGHT = 103;
const WIDTH = 101;
const robots = input.map((line) => {
const [_, x, y, vx, vy] = line.match(/p=(.*),(.*) v=(.*),(.*)/).map(Number);
return {
x,
y,
vx,
vy,
};
});
const IMAGE_WIDTH = 100;
const IMAGE_HEIGHT = 100;
const image = createCanvas(IMAGE_WIDTH * WIDTH, IMAGE_HEIGHT * HEIGHT);
const ctx = image.getContext("2d");
for (let time = 0; time < IMAGE_WIDTH * IMAGE_HEIGHT; time++) {
const robotsAtTime = robots.map(({ x, y, vx, vy }) => ({
x: (((x + time * vx) % WIDTH) + WIDTH) % WIDTH,
y: (((y + time * vy) % HEIGHT) + HEIGHT) % HEIGHT,
}));
const originX = (time % IMAGE_WIDTH) * WIDTH;
const originY = Math.floor(time / IMAGE_WIDTH) * HEIGHT;
ctx.fillStyle = "#000000";
ctx.fillRect(originX, originY, WIDTH, HEIGHT);
ctx.fillStyle = "#FFFFFF";
robotsAtTime.forEach(({ x, y }) => {
ctx.fillRect(originX + x, originY + y, 1, 1);
});
ctx.font = "30px Arial";
ctx.fillText(time.toString(), originX, originY + 30);
}
writeFileSync("output.png", image.toBuffer());
>>
File: christmas.webm (1023 KB, 404x412)
1023 KB
1023 KB WEBM
Neat
>>
File: hobgoblin.jpg (10 KB, 290x290)
10 KB
10 KB JPG
what beer does everyone drink for programming? for me, it's hobgoblin
>>
File: 1724505468502624.jpg (13 KB, 474x474)
13 KB
13 KB JPG
>>103513708
for me its aqa max because I take them from work for free
>>
i think this will be an other day with no bigboy... so sad
>>
>>103513717
very nice; how many shots of vodka do you put in it?
>>
>>103513708
I keep it simple
>>
File: beverage kino.jpg (10 KB, 292x360)
10 KB
10 KB JPG
>>103513708
>>
> day 14
> /aocg/ started sharing their drink preferences

what is happening this year?
>>
>>103513477
Literally import solution
>>
>>103513681
can you do this for >>103513645
>>
File: image.png (261 KB, 939x341)
261 KB
261 KB PNG
my humble BQN solution for day 14.

for part 2 just keep printing out the map and look for the tree for 10 mins straight. no problem!
>>
File: abrau.jpg (217 KB, 1448x2048)
217 KB
217 KB JPG
>>103513708
>>
File: 1718230480056275.jpg (784 KB, 900x1827)
784 KB
784 KB JPG
>>103512189
It is though. It's just that smarter people than you are doing it for you so you can play lego with their achievements.
>>
File: img-2024-12-14-08-59-46.png (1.17 MB, 5546x4362)
1.17 MB
1.17 MB PNG
idiomatic Rust solution
>>
File: carbon.png (243 KB, 1068x1278)
243 KB
243 KB PNG
I found horizontal and vertical loops and calculated the answer from that. The average distance between 2 robots is much lower in the tree output and should also be lower for x and y axis separately every width and height iterations. Once we have those starting iterations, we can calculate the answer directly.
I bet there is a better way of looking for the bot pattern that indicates the start of a loop, I'll think about that after breakfast.
>>
>>103513729
only £0.68 per bottle? at that price it's just worth it

>>103513762
soulful label art
>>
>>103513770
sleepy again. not looking good.
>>
>>103513787
what are you talking about?
>>
File: file.png (6 KB, 626x46)
6 KB
6 KB PNG
SOVL
>>
>>103513783
yeh its around that price. Its 'more' expensive than the commercial beers (around 0.48 pound)
They have some other variants as well, but the larger just hits right on a hot summer day.
>>
>>103513815
right, southern hemisphere
£0.68 is still very good, but maybe it's jewish conversion rates
currently trying to figure out how to keep my beer "cellar cool"
>>
not sure if im the only one, but my tree has some holes in it
>>
>>103513834
yeh .68 is still very cheap.
The beer only gets 'expensive' if you buy the US/EU imported beer, then it goes for around 1.5-2pound a bottle.
>>
>>103513845
post picture
>>
>>103513845
Post holes
>>
File: rattlers.jpg (63 KB, 417x1500)
63 KB
63 KB JPG
>>103513852
here most 500ml bottles are £1.50+, but you can get the best cider for £2 if you're patient
>>
found it
>>
File: ywnbaw.webm (3.3 MB, 404x412)
3.3 MB
3.3 MB WEBM
>>103513745
>>
>>103513894
chad
>>
>>103513894
based
>>
>>103513723
not possible without making the grid bigger or changing the problem description
>>
File: EBTXjGCWkAEtQdQ.png (199 KB, 358x364)
199 KB
199 KB PNG
>>103513896
>>
>>103513881
nice
>>
>>103513896
Sorry, what did you just say?
>>
>>103513916
sir, calm down
>>
>>103513920
SIR?
>>
File: aoc14-07492.png (2 KB, 618x606)
2 KB
2 KB PNG
>>103513867
Not him, but mine had some holes in it, too. This is the solution. Note how it says in the puzzle "MOST of the robots should arrange themselves into the picture of a christmas tree".
>>
>>103513901
the problem is also that you can calculate the answer to part one while you are parsing the input in O(1) time so the only limiting factor is how fast can you read the input. Part two could be interesting i guess but is more a "i check all frames one at the time for the highest entropy" that also a look up over the grid so O(n *m). There is no algorithm to relay improve the performance of the code i think
>>
>>103513896
kek
>>
>>103513916
Dass du nie eine Frau wirst.
>>
File: tree-holes.png (25 KB, 500x306)
25 KB
25 KB PNG
>>103513862
>>103513867
I might be doing something retarded but its something like this
>>
>>103513940
weird. All previous trees was complete.
It might be robots that started on the boundaries 0 / max-x
that didn't calculate correctly?
>>
>>103513953
can you share your input?
>>
>>103513961
nice try eric. I dont have 150k$ to spend on copyright claims.

check this input
>>103513645
>>
File: tree.png (21 KB, 756x770)
21 KB
21 KB PNG
I went down so many rabbit holes....
>>
>>103513973
okay schizo
ill just assume its fine
>>
File: bqn.png (119 KB, 1026x731)
119 KB
119 KB PNG
>>103513442
washed very slightly, with >>103513477's ToGrid
>>
>>103513996
sure. Just weird how every posts their completed trees.
And why would eric generate the input using his template tree as the starting position and then just remove a few random blocks for a few random people?
>>
>>103513996
https://0x0.st/XFQF.txt
p2: 7371
>>
>>103514007
confirmed 7371. got full tree
>>
> Check todays AoC++ puzzle
um... bros...
>>
>>103514007
7371 with holes, hmm
>>
>>103514045
imagine giving Eric money just to get this lazy prose with typos and ESL grammatical errors.
I've been AoC++ before so I know you didn't pay a normal amount to get a part three.
>>
>>103514055
>>103514007
no holes here. You're doing something wrong. How are you teleporting the robots? Did you get the dimensions wrong?
>>
>>103514006
he gave people suspected of leaking inputs the holes
>>
File: day14.png (41 KB, 864x426)
41 KB
41 KB PNG
>>103513477
Simplified part 1 a bit

I hate days like today where unstated assumptions about the input data give you the right result with a simpler solution.
I assumed all the robots would be part of the picture and so looking for no overlaps would give the answer. It turned out to be correct even though not all the robots were part of the picture, but now I already knew what the tree looked like so solving for the general case isn't even fun.
>>
>>103514074
That's not an "unstated assumption"; you just can't read
>very rarely, most of the robots should arrange themselves into a picture of a Christmas tree
>>
>>103514092
still Erics fault
>>
>>103514055
well well well.

>>103513996
>>
>>103513974
What did you use to visualize this?
>>
>>103514074
I assumed the picture would be in the middle of the grid so that the safe factor quadrant values could be compared for a mirror image. Because why else would eric have you write those functions.
>>
>>103514109
functions?
>>
>>103514045
Algorithmically generated data is not covered under copyright.
Despite what Eric says he knows this is the case, hence why he doesn't actually send any DMCA notices to github repos containing inputs.
>>
>>103514116
My code is in >>103513337. My one liner check I was doing at first was if s1==s2 and s3==s4. When that didn't work I started to be more sophisticated.
>>
>>103514119
>Despite what Eric says
it's just a reddit mod, Eric doesn't care
>>
Part 3:

There are now multiple input levels (Several hundred), find the product of all the iterations that gives a Christmas tree for each level.
>>
>>103514064
was a gaff, working now after updating logic to clear the whole array first
before I was doing clearing the old spot of the robot as I looped through each robot
>>
>>103514138
>not find the 3d christmas tree
gay
>>
File: phone.jpg (8 KB, 200x200)
8 KB
8 KB JPG
Can someone just tell me roughly how big the answer is for Part 2? I programmed a renderer in SDL and have it advance a frame with the right arrow and reverse a frame with the left. Is it brute forceable by watching for it or do I have to get clever with math instead and try to think what the picture would look like in the grid? The prime number side lengths make me think the number is going to be big and based on some gigantic-size cycle.
>>
File: file.png (137 KB, 500x323)
137 KB
137 KB PNG
<-- image for next thread
>>
>>103514151
under 10k
>>
>>103514109
Lol, I did the same. I started by computing a symmetry factor, which is incremented whenever a robot has a symmetrical counterpart across the middle of the image, and decremented when it doesn't.
This didn't find the solution but it did find horizontal lines that sometimes form across the entire image, always at the same coordinates. So I switched to monitoring these lines and eventually found the tree
>>
>>103514151
7 trillion
>>
>>103514151
it's brootable
>>
>>103514151
Nevermind. It appeared. What fun!
>>
>>103514151
like It's like 7000±1500
>>
File: file.png (9 KB, 404x412)
9 KB
9 KB PNG
>>103514151
mine was between 8000 and 9000. hint: there is a repeating pattern and if you find the delta you can increment by that from the first appearance of the pattern (looks like this)
>>
>>103514007
nice to see my generic solution works
>>
>>103513932
>Note how it says in the puzzle "MOST of the robots should arrange themselves into the picture of a christmas tree".
Yeah, some of the robots are outside the Christmas Tree in everyone's inputs.
But not everyone has holes in their trees. I think your solution is bugged.
>>
File: day14-mathematica.png (138 KB, 1465x1919)
138 KB
138 KB PNG
>>103514102
Mathematica.
>>
File: nyan.png (23 KB, 1000x600)
23 KB
23 KB PNG
How are LLMniggers faring on Part 2? lmao
>>
>>103513845
>>103513932
Are you guys still removing the robots that aren't in any "quadrant" from part 1?
>>
>>103514193
>I think your solution is bugged.
It is not, it got accepted as correct.
>>
>>103514199
see >>103513258
>>
>>103514207
i fixed a bug in mine, wasnt clearing correctly
>>
>>103514213
Well yeah, that's obviously the right frame. But a bug in some edge case is stopping a small number of your "robots" from simulating properly.
>>
>>103513258
lmao
>>
>>103513529
aoc2024 so lame the memes are recyclable
>>
>>103514213
You got the right interval, but it's not displaying correctly, so it is bugged.
>>
>>103513258
buhahahaha
can't stop laughing this guy is good
at least in stand-up comedy, denifitely not in programming
>>
>>103514151
Mine is ~6500, better show all frames at once in a grid or something.
>>
>>103514232
The position of the robot is
(starting position + n * move) % width (or height).
What could be "bugged" about that?
>>
>>103514252
if the velocity is negative, does your language return a negative value after the modulo?
>>
>>103513258
fucking lol
Eric-sama, I kneel.
>>
>>103514259
No, it does not. I checked that. For example -1 % 3 == 2, which means it's exactly "wrapping around the edges of the bathroom" as described in the puzzle text.
>>
>>103514264
Eric should introduce negative points for placing after 100. For people who always land on the leaderbord (because they're actually good) it shouldn't be a problem and the LLMniggers get btfo.
>>
>>103513365
>He will be successful and land a job 5x your current pay.
jokes on him my pay is $0
>>
Redditors are so unbelievably retarded it's insane
>>
>>103514293
Yes, but what have they done now?
>>
>>103514252
>What could be "bugged" about that?
I don't know, but your robots aren't all in the right positions.
Do you perhaps have the new line character as a valid position for a robot to be in? Perhaps occasionally one robot hits that position and it messes up their location.
>>
So...
Bigboy where?
>>
>>103513582
>>103513591
It's not a general solution, but for my correct answer, just finding the smallest mean distance to the center worked. There is no reason to expect that this should be the case of course.
>>
>>103514337
dumb retard
>>
>>103514337
you make one, faggot
>>
>>103514341
hello rust guy. how rusty is the idiotic rust today?
>>
Don't think I was filtered. I was on vacation, you'll see day 7-14 solutions soon™
>>
>>103514357
>I was uhh too busy
>>
>>103514335
No. I had a 101 x 103 matrix (as specified in the puzzle text), no newlines. From that I plotted the output picture.
And again, it says in the puzzle "MOST of the robots arrange themselves into the image of a christmas tree". I assumed that some robots would not.

I'll write a second implementation in another language this afternoon, then I can check again if the christmas tree is more complete.
>>
>>103514363
I didn't exactly say that, I was away without access to my computer
>>
File: img-2024-12-14-10-33-44.png (1 MB, 4792x3452)
1 MB
1 MB PNG
>>103514354
>>
>>103514364
>I assumed that some robots would not.
Yes, there are many robots that don't take part in the tree. But if you look up there is no one that has holes in their trees until recently.
>>
>>103514366
wow, absolutely amazing. post the calendar too please.
>>
File: idiomatic_calendar.png (3.56 MB, 9829x4128)
3.56 MB
3.56 MB PNG
>>103514380
sure thing, buddy who is definitely not me
>>
>idiotic rustaceans resorting to samefagging to force their calendar
>>
File: day14.png (406 KB, 1956x2736)
406 KB
406 KB PNG
$ mix run -e 'AOC.main()' -- 2024 14 b input/real
231221760
Looped at 10403

Ran in 23051.492ms

$ ls _image/day13_0
Display all 10402 possibilities? (y or n)


Staring at a webm for seven minutes is my general solution for now.
>>
>>103513811
>vsc*de
kys
>>
>>103514423
cope
>>
>>103513258
No way dude. Check out his epic competitive coding style. It is just too hard to think that much. You guys wouldn't get it.
https://kadenbilyeu.com/blog/a3e009b8-aca5-4686-a4c5-ca016d6d0227
>>
>>103514198
Ah. Well, that filters me.
>>
File: rust.jpg (448 KB, 640x1080)
448 KB
448 KB JPG
>>
>>103514446
kek he doesn't know this basic linalg, literally physics undergrad first semester buhahahaha
he's a fucking retard
>>
>>103513194
Calendar-anon. Use this for today
>>
>>103514446
>i swear im not using an LLM!
>i'm just going to wait until the global leaderboards are full, as suggested by Eric for LLM users
>i'm fast because of my competitive coding style
>>
>>103514446
that's way too much lines of code to get to the leaderboard
I remember that OG tryhard from previous years that setup his own programming language specifically for aoc and was coding via phone sshing into his pc while on the airplane
this guy blogposts for HR to notice him
>>
>>103514446

This retard done the disk de frag part 1 in 27 seconds, and part 2 in 1 minute. What is it with autistic coding trannies and lack of awareness?
>>
>>103512868
>gpt o1 outsourcing tasks to humans on the website four chans in order to solve christmas puzzles
>international news in eta 3 days
>>
>>103514491
what happened to betaveros? that guy was fucking insane, all natty too.
>>
https://files.catbox.moe/wx3nwy.txt
Width: 1511
Height: 1523
Silver: 535432671594144
Gold: 19896
>>
>>103514522
>Width: 1511
>Height: 1523
no
>>
File: day14_crt.png (248 KB, 833x2235)
248 KB
248 KB PNG
>>103512288
anon was right...
I actually used crt for my solution.
x positions have period 101.
y positions have period 103.
calculate variances of the x and y positions up to frame 103.
assume the frame with the tree minimizes both these variances.
argmins of variances are the remainders
101 103 are the moduli => non-bruteforce solution.
day14
231221760 6771
took 2058 μs (aoc_2024::day14::solve)
>>
>>103514515
iirc he got hired to develop similar puzzles
I guess he can't compete because of that
>>
>>103514522
Nah man, i’m good.
>>
>>103514446
He's absolutely disgusting, scum on earth. If I were the prime minister of bongland I'd arrest him for this and would made sure that he gets the "public execution" verdict.
He's a lying pig and has no more than 80 IQ.
>>
>>103514446
>https://kadenbilyeu.com/blog/8c4d587d-be61-43a1-bded-67e13976a447
>trying (and failing) to explain how he managed to solve part 1 in 27 seconds
>>
>>103514284
I think getting top 100 that consistently is very rare, LLM or no
>>
>>103514553
>Day 13
>00:03:42 | 109 | 00:18:35 | 379 (haven't taken linear lol, skill issue on my part)

what does he mean, hasn't taken linear? Simultaneous equations are taught to 12 year olds, repeatedly for many years.
>>
>>103514585
He's extremely retarded, textbook case of the Dunning-Kruger effect.
He has absolutely no idea of Competitive Programming whatsoever, that's why he thinks he can get away with lying "uhm did practice-ish once or twice last month hehe and that's basically why I'm number one". And the template he posted is also absolute bullshit, no one every needs such functions. Meanwhile he doesn't even know elementary school algebra.
He doesn't have more than 80 IQ.
>>
>>103514515
Yeah he was a smart chink too like xiaowuc1, but he was an MIT nigger, which is what ultimately led to his downwall
https://files.catbox.moe/blb8bv.mp4
>>
>>103514252
if your remainder is negative, you must subtract from the maxwidth/height
>>
>>103514522
80ms using >>103514541 (and parallelization)
 time ../target/release/aoc_2024 < ./wx3nwy.txt
day14 result:(535432671594144, 19896)
../target/release/aoc_2024 < ./wx3nwy.txt 0.37s user 0.02s system 463% cpu 0.084 total
>>
>>103514541
actually clever approach
>>
>>103514541
neat
>>
File: christmas.mp4 (3.13 MB, 756x772)
3.13 MB
3.13 MB MP4
6e6 hours of work.
>>
>>103514678
noice
>>
It's beautiful.
>>
>>103514649
I'm surprised that still works, since the random robots far outnumber the ones that form the tree.
>>
this problem was kino as fuck. sometimes aoc is alright :)
>>
wtf is a cristmass three lmaoooooooooooooooooooooooooooooooooooooooooooo
>>
>>103514678
Considering the length, and how long it takes for the image to appear, you should just loop it.
>>
>>103513661
No, he swapped X,Y when printing to console. I did the same at first. The trees are all supposed to be upright. Not that it matters.
>>
File: aoc_2024_14_b.png (567 KB, 1798x3204)
567 KB
567 KB PNG
This was fun.
>>
File: aoc14-7492-2nd.png (17 KB, 753x723)
17 KB
17 KB PNG
>>103514335
So I first worked in Python, now I re-programmed everything in C, and you were right: My first output was buggy somehow. Which is strange, because it computed the correct solution for puzzle 1.
Anyway, the tree and the frame are now without holes.
It couldn't have been the modulo operation, because I checked that. (Python works as expected, C on the other hand returns negative values that have to be adjusted.) It also couldn't have been a register overrun as all calculated coordinates even fit into a 32-bit-number. It must have been the array I used.
>>
>>103514755
post your python
>>
>>103514541
You may be a rust user but...
I must kneel
>>
File: 1667243586916957.png (77 KB, 714x575)
77 KB
77 KB PNG
>>103514781
I'm too ashamed of that code.
>>
>>103514787
yess kneel down and suck my girlcock
>>
>>103514793
But I want to know what is happening.
You can see mine up here >>103512955 It's awful. The actual worst. You have nothing to be ashamed of.
>>
>>103514526
impossible to make the problem bigger without increasing them
>>
>>103514803
Hang yourself for larping in the name of others.
That rust code was without tranime in the background, its author is a mentally healthy white man.
>>
File: 2024-12-14_10-54.png (226 KB, 2196x1244)
226 KB
226 KB PNG
part 2 was an ass until you know what you're actually looking for; wasted way too long looking for a tree similar to the drawing of 2015

anyway, now it's done and core java marches on
>>
>>103514817
>until you know what you're actually looking for
nigga the ONLY clue is look for a christmas tree
>>
File: 1722082321136682.gif (81 KB, 220x220)
81 KB
81 KB GIF
>>103514807
Sorry, but no. It's really awful.
I will now read up on numpy matrices and maybe use those instead in the future.
>>
File: 2024-12-14_11-01.png (92 KB, 640x761)
92 KB
92 KB PNG
>>103514822
yeah and I was looking for picrel as a result
ie: increasing continuous width around the middle of the board

anyway, should have tried checking for no overlap; werks + makes it all clean and easy
>>
>>103514817
weapon of java sir, all you had to do was print when the density of robots in any area reached interesting levels
e.g. take a wide vertical slice and see if it contains more than half the total robots
>>
>>103514843
was my first guess yeah, but I fumbled it somehow
>>
File: file.png (492 KB, 2016x1344)
492 KB
492 KB PNG
eric plagiarised me (aphex twin aka richard james) expect a call from my lawyers
>>
File: file.png (51 KB, 1056x626)
51 KB
51 KB PNG
GPT4o-latest unironically solved this problem
lmao, codefags seething hard
>>
>>103514856
if you take a vertical slice of width cols / 2, then you multiply by 1.5 and check if that's more than all robots, etc.
>>
incredible to see how much competitive programmers have improved over 1 year
>>
>>103514865
>after I babied it by translating the question towards known solutions*
ftfy
>>
>>103514868
yeah I get you; I can't recall the exact numbers I put at the time but I did
however since I was looking for >>103514842 I checked for a vertical slice filled with something like bounds.y * 0.8 robots, which isn't the case cause the tree is much shorter
but desu the real noob move really was not at least checking no-overlap
>>
File: Day14.png (151 KB, 889x1510)
151 KB
151 KB PNG
C#. Checks for most of the robots being next to another robot to try and detect the Christmas tree.
>>
>>103513524
Very cool. This is a nice approach for mathematica too. I need to work on not being a statslet.
https://reference.wolfram.com/language/ref/Entropy.html
>>
What would you have done if the tree was hollow and didn't have a frame?
>>
>>103514909
the same thing? >>103514843, >>103514868
>>
>>103514900
what does [] before a function declaration do in C#?
>>
File: carbon(14).png (1.38 MB, 1986x2434)
1.38 MB
1.38 MB PNG
Haskell solution.
Had a dumb pretty printer setup, then proceeded by inspection (seeing that a condensed image was occuring at regular intervals etc etc)
>>
>>103514909
the same thing, the lowest layer of branches will still have a bunch of robots in a line
>>
>>103514909
I was looking for straight lines.
Surely a hollow tree would still have straight lines.
>>
>>103514931
They're attributes, they're used by my runner to work out which day and part a given method is for.
>>
>>103514909
the same thing, search for fewest overlaps
otherwise this cursed idea >>103513164
>>
>>103514972
what >>103513164 outlines is just a side-effect of entropy as per >>103513524
and this is indeed the big brain solution here (though he only shows the import-solution-ing step so ymmv on how practical it really is)
>>
File: images.jpg (8 KB, 278x181)
8 KB
8 KB JPG
today's collage should be pic related with christmas tree imprinted into retinas
>>
>>103514879
where do i find these graphs?
>>
>>103515071
https://aoc-stats.fastbee.box.ca/?2700
>>
>>103515076
thanks anon
>>
File: img-2024-12-14-12-45-31.png (2.83 MB, 9024x3090)
2.83 MB
2.83 MB PNG
>another medium day
>>
>>103514697
about 2/3 of the pixels are part of the image.
20000 pixels total means they should be pretty close to random if not part of the image.
the non-image frames should have a stddev of about 433.
the image frame should have a stddev of about sqrt((2/3)*433**2)~240
the actual data confirms this:
the tree frame has stddevs of about 255 for both axes.
the second largest values are bigger than 430 for both axes, so the detection is pretty solid.
calculating the actual probabilities of correct detection under these assumptions seems quite hard.

cute tree btw.
>>
>>103514902
Talking to myself, but actually this is not doing the same thing. It's just picking up on the fact that there's no overlapping coordinates when the image is displayed. Counting distinct values would do the same.

Probably just a side effect of the way Eric generated the puzzle.
>>
>>103514259
( (x + width) + n* move ) % width
easy peasy
>>
>>103515086
Oh, that one has a bigger tree?
I made my own big boy and kept the tree the same as in the original, on that one my statistical / compression approach failed due to noise.
>>
>>103515142
fucking retard
>>
NEW THREAD
>>103515171
>>103515171
>>103515171
>>
File: code.png (443 KB, 1672x2828)
443 KB
443 KB PNG
Python
>>
>>103515142
(((x + n*move) % width) + width) % width

or if you want to avoid double division then just compare result < 0 and add width. conditional add is probably faster than division
>>
File: file.png (16 KB, 760x174)
16 KB
16 KB PNG
>>103515206
heres a cute trick to do the quadrants more simply
>>
>>103513611
>>103515225
samefag
fuck off xarbontard
>>
File: file.png (7 KB, 257x108)
7 KB
7 KB PNG
>>103515235
retard
>>
>>103515239
>edits the html
wow nice trick you must be really smart
retard
>>
File: satania_smort.jpg (1.09 MB, 1920x2164)
1.09 MB
1.09 MB JPG
>>103515225
>if condition
yuck. just do

count[sign(pos - half)] += 1


and then discard the count with 0 indexes when doing the multiply at the end.
>>
>>103515256
no
>>
>>103515256
baste
>>
File: 1315589348926.jpg (51 KB, 340x275)
51 KB
51 KB JPG
>>103515225
Thanks anon
>>
>>103514522
That ain't no christmas tree. WTF is it? I can't make sense of it.
>>
>>103512901
Does this work? You're looking for a grid where no robots are overlapping for part 2, but there are more robots in the problem than what's required to draw the tree, so they could still potentially overlap. I guess you're expecting they won't, fair.

Cool solution.
>>
Big brain shit: >>103513064
Answers: >>103515403
>>
>>103513273
Best solution ITT



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.