[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

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


>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: >>103604614
>>
File: solve.png (609 KB, 5708x3452)
609 KB
609 KB PNG
idiomatic Rust solution
>>
seething that i got filtered on 21 now that i actually figured it out
i should have done it yesterday
>>
>>103608644
there's two people who post the filter graph, one excludes people who took over 24 hours and the other has no requirements beyond having all starts up to the current date
so you're only half filtered as long as you have all 50 stars on christmas anon
>>
>>103608673
nah i ascribe to the 24 hour filter
just disappointed i didnt push through and figure it out yesterday because it wasnt actually that bad
>>
Total Monkey Death
>>
File: day22_parallel.png (156 KB, 614x1528)
156 KB
156 KB PNG
now parallelized about 2.5s on the bigboy.
>>
File: aoc_22.png (343 KB, 2000x1000)
343 KB
343 KB PNG
Only one hard problem this year
>>
>>103608712
the last hard problem in aoc
>>
>>103608718
Don't say that anon. You are making me cry :(
>>
2.5 mins on bigboy. I'm somewhat satisfied with that. Know ways I could speed it up considerably but don't want to bother
>>
File: MonkeyBusiness.jpg (166 KB, 1280x720)
166 KB
166 KB JPG
>>
https://www.youtube.com/watch?v=YO7M0Hx_1D8
thread theme
>>
File: code.png (373 KB, 1612x2588)
373 KB
373 KB PNG
Python
>>
>accidentally check for max for a given sequence
oopsie poopsie.
>>
Banged my head against this last night just to realize I could just use sequences as a hashmap key instead of searching every sequence in every price list manually. No clue what I was thinking there
>>
bros help me out with day 21.

Current idea is to map each (level, key_from, key_to) triple to the number of keystrokes you'd need on your starting dirpad. Level 0 is 1 for everything (since you just press the key). For later levels you find the two L paths, translate to the keypresses you'd need, and look them up with the cache you made for the previous layer. Once you have the cache you can easily look up any code.

Is this the right approach and I need to debug moar, or am I missing something?
>>
>>103609335
>(level, key_from, key_to)
the caching of (level, key_from, key_to) sounds like youre onto the right idea
just need to set it up right to actually calculate that (as it involves other levels to get the result)
>>
>>103608640
is *19 enough bits for negative and positive 0-9?
>>
Bros? Who the fuck claimed yesterday was like day 11? each future sub pattern depends on the previous pattern. For the plutonian pebbles, the relationship was completely detached from sub problems so you just had to keep splitting and counting.
>>
does anyone else just go back and stare at their code for previous puzzles just because it looks nice
>>
>>103609587
I think some anons found the optimal mappings and thus paths so that the whole thing becomes linear.
>>
>>103609690
Yep and more often than not I notice immediately ways to simplify it that I could not see on the problem's day.
>>
File: calendar.jpg (3.74 MB, 7986x4112)
3.74 MB
3.74 MB JPG
>>103609690
of course
>>
Total Idiotic Rust Death
>>
File: codesnap6.png (492 KB, 2012x2610)
492 KB
492 KB PNG
Any lispers left?
>>
>>103609821
not going to happen
>>
>>103608712
Two, assembly and yesterday were pretty rough.
Also always possible there's another one or two difficult ones in the final few days.
>>
>>103609821
Idiomatic rust guy will keep posting for as long as it keeps giving him guaranteed (You)s every time
>>
>>103609908
he's annoying of course he'll keep getting attention not good attention but still attention
>>
>>103609821
>>103609908
>>103609935
someone post the manfiesto
>>
>>103609908
you have to understand these people are mentally sick, it doesnt matter if you give them attention or not they'll do it anyway
there are people who keep completely dead generals alive just to repeatedly post their nonsense even though theres no one there to see it
>>
>>103609970
>these people are mentally sick
you mean rust programmers?
>>
>it's the first sequence not the best sequence
advent of reading comprehension
>>
File: d22.png (621 KB, 1606x4128)
621 KB
621 KB PNG
>>103606414
sh-5.2$ # single-threaded
sh-5.2$ hyperfine -w 2 -m 5 -N './22_st ../../../inputs/22/bigboy.txt'
Benchmark 1: ./22_st ../../../inputs/22/bigboy.txt
Time (mean ± σ): 7.253 s ± 0.042 s [User: 7.244 s, System: 0.002 s]
Range (min … max): 7.212 s … 7.323 s 5 runs

sh-5.2$ # multi-threaded (4c8t coffee lake)
sh-5.2$ hyperfine -w 2 -m 5 -N './22_mt ../../../inputs/22/bigboy.txt'
Benchmark 1: ./22_mt ../../../inputs/22/bigboy.txt
Time (mean ± σ): 1.749 s ± 0.007 s [User: 13.818 s, System: 0.020 s]
Range (min … max): 1.739 s … 1.756 s 5 runs

yesterday was more fun
>>
File: im-1734887652223.png (24 KB, 494x548)
24 KB
24 KB PNG
RETVRN
>pytoddler solve
what the fuck was this puzzle, this was a day 4 difficulty. i was almost certain that part 2 would involve millions of iterations, finding cycle lengths, and the kind of thing we're used to seeing.
was there anything clever to do here?
>>
>>103610171
He wanted to give us a break after the keypad madness.
>>
>>103553087
>>thread indexer filtered
Maybe not yet
>>
File: im-1734887999298.png (2 KB, 237x79)
2 KB
2 KB PNG
>>103610179
wonder if we're gonna get a "sea monster" / "3d cube" type puzzle this year. we still haven't got that flavor yet.
>>
>tfw couldn't figure out how to do part2 without brooting
at least got my stars
what's the smart way to do this, anons?
>>
>>103610236
Map each 4 difference tuple to a sum of prices
>>
File: day22.png (399 KB, 1111x1516)
399 KB
399 KB PNG
>>103606414
$ mix aoc.solve 2024 22 b input/bigboy/
8385838872479
879695

Ran in 1050825.641ms

lole
>>
File: 22-1.png (24 KB, 705x192)
24 KB
24 KB PNG
>>103610196
>Sea monster
Definitely a possibility.
>>
File: 1708887581636933.png (29 KB, 1125x971)
29 KB
29 KB PNG
guys I think it spells out a 10, but why?
>>
>>103610431
It says so on the 0. (If you solve days 16 - 18.)
>>
File: fufu.jpg (194 KB, 948x950)
194 KB
194 KB JPG
>>103610431
ideal female age
>>
Due to the 10 links per post limit, this will be a bit long.
For those that don't like these posts, the name and trip are added to ease filtering them out.

2023 #58 >>98107863

#-1 >>103331794
#0 >>103352712

d1 >>103362965
#1 >>103364801
#2 >>103369303
#3 >>103374603

d2 >>103375628 >>103375641
#4 >>103378303
p1/7
>>
#5 >>103384151

d3 >>103386498
#6 >>103388939
#7 >>103393964

d4 >>103398502
#8 >>103399209
#9 >>103403621
#10 >>103408470

d5 >>103409858
p2/7
>>
#11 >>103413251 >>103413259

d6 >>103422105
#13 >>103424466
#14 >>103432240

d7 >>103433546
#15 >>103437490
#16 >>103442187

d8 >>103445067
#17 >>103447426
p3/7
>>
>>103610431
Anon, how do you know it is a 10?
>>
#18 >>103453726

d9 >>103456214
#19 >>103458931
#20 >>103466287

d10 >>103467828
#21 >>103471260
#22 >>103478070

d11 >>103479097
#23 >>103481467
#24 >>103487465
p4/7
>>
d12 >>103490316
#25 >>103491900
#26 >>103497953

d13 >>103500794
#27 >>103503635
#28 >>103511653

d14 >>103512513
#29 >>103515171
#30 >>103521643

d15 >>103523407
p5/7
>>
#31 >>103525934
#32 >>103533936

d16 >>103534450
#33 >>103538057

d17 >>103545590
#34 >>103548198
#35 >>103554593

d18 >>103557381
#36 >>103559822
#37 >>103568820
p6/7
>>
p7/7
d19 >>103570510
#38 >>103574248

d20 >>103581732
#39 >>103583342
#40 >>103588803

d21 >>103593595
#41 >>103596224
#42 >>103604614

d22 >>103605207
#43 >>103608634
>>
>>103610554
good point, maybe it's a race track and the stands
>>
File: BMJ gottagofast2.gif (3.86 MB, 280x420)
3.86 MB
3.86 MB GIF
>>103610581
>>103610564
>>103610594
>managed to get 4 perfectly-timed FUCKs
Nice.
>>
>>103610594
Thank you for your service. Really handy for jumping back through the archives.
>>
File: 1720235139574885.gif (701 KB, 300x244)
701 KB
701 KB GIF
bananice!
>>
File: day22clojure.png (516 KB, 892x795)
516 KB
516 KB PNG
>>103609824
yeah, I'm a survivor (we're a dying breed)
>>
>>103609824
Yes doing it in CL, unfiltered, still LOOPing.
>>
Most of the time in my code is hashmap activity (growing, hashing). I reduced my key down to a 32 bit number but it's still slowish. What do?
>>
>>103611004
Replace hash map with array
>>
>>103608640
This is why I always use itertools. tuple_windows is just too powerful vs keeping a mutable cell like you're doing for differencing.
But then I have to wonder, can you not map_windows twice?
>>
>day 21 finally got it
>works on example
>doesn't work on input
eric sama not like this.......
>>
>>103611079
I use a Cell because I have to update the secret number each step and also read the last digit of it each step. Without a Cell I would run into trouble because of the mutable borrow that is needed to update the secret number each step.
I could restructure my solution, but using a Cell is easier.
>>
File: tti.jpg (113 KB, 710x823)
113 KB
113 KB JPG
Just finished day 21
>>
>>103611281
Welcome hannibal
>>
Finally these threads will end. Sick of seeing this circlejerk and waste of effort.
>>
>>103611526
filtered
>>
>>103611526
filtered
>>
>>103611526
kys no coder
Also filtered.
>>
>>103611281
Only part 1 is hard (I ended up hardcoding all transition).
Part 2 was easy ("just DFS with memo") but most people were too tired after part 1.
>>
>>103611535
>>103611556
>>103611577
>they think their little christmas kiddie problems make them real programmers
guess you'll be Coding again in 11 months :)
>>
>>103611526
> waste of effort.

sir, we are saving christmas here.
>>
>>103611647
If they're so trivial, do them all. Bitch.
(Ironically this year is pretty much baby shit)
>>
>>103611661
>>(Ironically this year is pretty much baby shit)
>doing damage control in your own post
yike
>>
>>103611602
>Only part 1 is hard
More like tedious.
>>
>>103611647
I love how many real programmers get fraud-checked by AoC.
>>
File: file.png (733 KB, 1048x1280)
733 KB
733 KB PNG
>>103611526
>>
>>103611694
Good on your for admitting you are not one.
>>
>>103611676
Nah, it was fun. It took a while to intuitively understand why some move patterns were more optimal or detecting the case at all.
>>
>>103611602
Part 2 is either "replace 2 with 25" or "your code is worthless and you're fundamentally wrong in how you think about this problem"
>>
File: production quality.png (237 KB, 1301x1197)
237 KB
237 KB PNG
More salt from "real programmers".
>>
>>103611263
Fencepost error? It got me.
>>
File: tgf.png (958 KB, 2039x2117)
958 KB
958 KB PNG
>>
>>103611810
Production quality software is universally shit and barely fit for the task. The amount of times I see people find ways to work around shit software is unreal and makes me wonder why we haven't had total developer death.

I hate these faggots and I hope they die of AIDS.
>>
File: codeimage-snippet_22(1).png (558 KB, 929x2620)
558 KB
558 KB PNG
It's not idiomatic, but by God it works
>>
>>103611263
Remember that you have to check ALL the sub patterns as you expand it N times to find the smallest at N.
>>
File: I must be an idiot.png (257 KB, 1300x1452)
257 KB
257 KB PNG
Crabs in a bucket hugbox. All of these people could benefit from being called retards instead of settling for mediocrity.
>>
>>103611281
>two days later
Still filtered
>>
File: 53v3vv558v503v.jpg (61 KB, 596x628)
61 KB
61 KB JPG
>>103611880
>somehow it worked - although I'm already two days behind
>>
File: my time.png (202 KB, 1271x1404)
202 KB
202 KB PNG
Oh my. I've had success in the mine today. This fag is absolutely boiling.
>the challenges are disrespectful towards my time.
>>
>for each buyer, you'll have 2000 price changes in which your sequence can occur
I only got the answer if I generate 2001 price changes. What did I miss?
>>
>>103611915
>take hours
Yesterday took me less than 2 hours, this plebbitor is just a dumb retard
>>
>>103611880
>>103611915
>>103612019
t. no job, no responsibilities
>>
>>103612018
Secret num + the 2000 generated = 2000 differences.
>>
>>103612018
Sure it's not 2001 prices meaning 2000 changes?
>>
File: 1315708217721.jpg (44 KB, 482x372)
44 KB
44 KB JPG
>>103611915
Good god.
Typical rabbit.
You just cannot enjoy even their tears.
It leaves a bad taste knowing these people exist and worst have the balls to make themselves known to others.
>>
>>103609690
no, my code is shit and im always happy to move on
>>
>>103612049
>>103612053
no, i mean 2001 price changes, which is 2002 prices including the initial number
>>
>>103612075
A case of n numbers generating n-1 differences?
>>
>>103612035
nigger one of them stated that he woke up at 6am, there are 3 hours between 6 and 9.
He could have easily done all days under 3 hours each. They're just retarded, but this is your average job haver nowadays. 80 years ago (Alan Turing, von Neumann) the niveau was a bit higher
>>
>>103612075
Post your last 10 changes for the demo input
>>
>>103612075
???
You have to generate the same number of numbers as part 1 and the first pair you diff is (start, gen[0])
>>
File: img-2024-12-22-21-41-37.png (93 KB, 1920x772)
93 KB
93 KB PNG
>>103611915
lmao
>>
>>103612100
Anon, people with responsibility usually have a bunch of things to do before they leave for work.
>>
>>103612101
Nvm, I got it. I had off-by-one error when generating the price map.
>>
>>103612112
>he does work before going to work.
what do you do after work?
>>
>>103612110
I hate reddit
>>
>>103612075
post input + answers
>>
>>103612112
Sounds like a lot of words for saying filtered...
>>
>>103612100
Neumann could probably solve every day without a computer.
>>
>>103611843
Can I unfilter myself if I finish the day the filtered me before the 25th?
>>
>>103612035
I have a 2 year old son, a pregnant wife, a full-time job, and 44 stars. Absolute cope.
>>
>>103612281
No, you only have 1 hour per problem.
>but what about day 21?
Yes, everyone but 89 people were filtered that day
>>
>>103612297
based
>>
>loop through each monkey's 2000 secret numbers with a 4-sized sliding window
>find the first occurrence of each unique 4 number sequence per monkey
>add each of those sequences to an overall set of all seen sequences
>loop over all seen sequences and check against each monkeys set of sequences
>take the maxiumum

This feels retarded and is quite slow (~10 seconds), but it works. How do I speed it up?
>>
File: Capture.png (9 KB, 208x290)
9 KB
9 KB PNG
>>103612281
No. I have been filtered before and never cried about it so man up and hold your tears.
>>
>>103612281
Yes. Santa's list is long and brutal, but it's forgiving. You can get off the filter list.
>>
>>103612110
>great idea, retard gorilla nigger execution
>>
>>103612336
That's what I do but with arrays and it finishes in 50ms. You're probably getting fucked by hashmap collisions or using python for it to take that long.
>>
What the FRICK are the states/transitions for D21?
>>
>>103612727
Which keys you are moving from and to, and which level you are on.
>>
>>103611526
Yup finally /g/ can return to 20 different threads full of AI slop.
>>
I DID IT I FUCKING DID IT!!! I SOLVED DAY 21!!
>>
File: 1729795964457619.jpg (103 KB, 367x470)
103 KB
103 KB JPG
>>103613059
grats anon
>>
>>103612281
You're still "filtered" but you're not a complete failure if you complete.
>>
File: eric slop.mp4 (1.29 MB, 720x720)
1.29 MB
1.29 MB MP4
>>103612993
You can try to avoid the slop, but eventually the slop finds you.
>>
>>103613343
is this real?
>>
>>103613472
you didn't know eric was a monkey all along?
>>
>>103612336
I used a defaultdict(dict) to track the first instance of each sequence for each monkey, then summed the dictionary values for each sequence and found the maximum. Which also seems like a retarded solution but it completed in 6 seconds and I can't be arsed to come up with something better.
>>
>>103613472
Where do you think the thousands of bananas we're earning on the stock exchange are going?
>>
File: 1734899876885680.webm (739 KB, 416x624)
739 KB
739 KB WEBM
>>103612993
>>
just brooted 2016 d11
>>
File: d22_lut.png (626 KB, 1606x4016)
626 KB
626 KB PNG
>>103610124
Update, I've managed to achieve a sub-second multi-threaded bigboy by embedding a ~200MB LUT, something like >>103608199 hinted at.
It's a small price to pay to please bigboy-chan
sh-5.2$ ls -lah ./22_mt
-rwxr-xr-x 1 vhk vhk 193M Dec 23 00:25 ./22_mt
sh-5.2$ ./22_mt /tmp/bigboy.txt
Silver: 8385838872479
Gold: 879695
sh-5.2$ hyperfine -w 5 -m 10 -N './22_mt /tmp/bigboy.txt'
Benchmark 1: ./22_mt /tmp/bigboy.txt
Time (mean ± σ): 928.1 ms ± 6.2 ms [User: 3671.8 ms, System: 17.0 ms]
Range (min … max): 920.4 ms … 937.4 ms 10 runs
>>
File: 1733920858597236.jpg (88 KB, 720x1088)
88 KB
88 KB JPG
>>103613721
awk -f day22.awk input.txt
110.83s user
0.33s system
99% cpu
1:51.45 total


How on Earth do I optimize this so BigBoy-chan doesn't bend me over and make me her bitch? I'm just doing the naive approach.
>>
>>103613721
>precomputing means i don't spend so much time comouting
>>
What if your compiler is really smart and knows your program always spits out the same number so optimises your code into just printing that number?
>>
File: day22_galois.png (455 KB, 871x4432)
455 KB
455 KB PNG
>>103613721
nice!. I went a different way.
I can do part 1 in 70ms again using a precomputed matrix (A to the power 2000).
for part two I managed to implement a position prediction. (i.e. given a number I can find it's position in the cycle within 100 micros)
implementing that bullshit took so long that I completely forgot what I was doing. But hey now I can factor poynomials in GF(2^24, modulus= X^24 + X^17 + X^15 + X^13 + X^11 + X^4 + X^3 + X^2 + 1).
>>
>>103610471
>posts a hag
>>
Can it just be over? I'm so bored bros
>>
>>103614025
https://pages.cs.wisc.edu/~cs812-1/coppersmith.pdf
this basically breaks erics xorshift RNG
>>
>>103613999
Working as intended.
>>
>>103613999
They do do that when they can and it doesn't take too much compute, or you specifically make everything compile time
>>
>kino tier
17 (intcode)
22 (keypad)

>kinda neat tier
9 (defrag)
11 (pebble)
14 (tree)
19 (towel)

>shit tier
everything else
>>
Hooray! I finally finished Day 21. I ultimately had to get some hints on why certain transitions were better which finally made it click, but I was 95% of the way there on my own. Still consider myself filtered because of that, but nice to know I was on the right track from the start.
>>
File: file.png (106 KB, 2400x2400)
106 KB
106 KB PNG
The most powerful "ooh ooh aah aah" in the world
>>
>>103613999
Sometimes that is possible:
https://godbolt.org/z/ndszM9KPe
>>
File: sr.png (587 KB, 1094x534)
587 KB
587 KB PNG
>>103611810
The era of webshit is drawing to a close
>>
>>103613721
holy that's fast. esp. since it's only 4 cores.
>>
>>103613721
Cool
I'm kind of surprised it isn't faster though, since my single threaded unoptimized with no LUT was 9 seconds
>>103614025
Also very cool
But reversing the hash/position prediction doesn't actually help solve the problem, does it? You still need to check 2000 differences for each bidder? Or am I misunderstanding?
>>
>>103614204
Your drawings are all very creative and good /aocg/ does not deserve you
>>
>>103614204
>$HDSP

Filtered me, wtf is that?
>>
>>103614198
Day 14 was kino purely because of the seethe generated by people who don't know what a christmas tree looks like.
>>
>>103614292
yeah, I got way too sidetracked. I was thinking that I could maybe "transport" a single "sensibly sized" lut around using the discrete log. so a lut for x=1 and then do A**n*lut for each value. but computing on the fly is so cheap, that it's totally not worth it.
>>
>>103612110
>coal execution
I didn't know /r/aoc was into 'teen speak.
>>
>>103614335
Possibly short for "hiding spot"?
>>
>>103614335
idk maybe the story readers have an idea
>>
>>103614198
18 (ram run) was kinda neat.
>>
>>103614198
12 (garden groups) is kino tier
>>
>>103614536
It was just another maze puzzle in the chain of identical maze puzzles. I hoped part 2 to be about dynamically making a path while avoiding the falling stones and got totally disappointed. The concept of falling stones is completely wasted
>>
>>103612110
Gem
>>
>>103614536
Should've made part 2 part 1 and done something interesting after like >>103614560
>>
Today's upcoming puzzle will involve more directional arrows (<, ^, >, v), but there will be an incredibly difficult twist (similar to the monkey cube problem). The global leaderboard will have only 14 or 15 people who solved both parts after an entire hour.
Source: It was genuinely revealed to me in a dream
>>
File: 535g3.jpg (34 KB, 750x750)
34 KB
34 KB JPG
>>103614218
I was joking I didn't think they could actually do that
>>
>>103614609
>incredibly difficult twist (similar to the monkey cube problem)

Pick one
>>
Is this actually the last year of AoC?
>>
Any bets on where the Chief Historian is going to be found?
>>
>>103614667
No, LLMs will continue generating problems and reddit mods will keep moderating the subreddit every year until the collapse
>>
>>103614725
In their office from day 1. It was all a wild goose chase
>>
>>103614725
In the toilet with a skibidi crossover
>>
>>103614725
Inside Advent of Code itself. We've already gone inside a computer twice this year, going into a website isn't out of the question.
>>
I did the mistake of --force-reinstall-ing matplotlib and can't get rid of the ugly white padding
>>
>>103615195
mogrify --trim myimage.png
>>
>>103615195
>can't get rid of the ugly white padding
AoC++ problem just dropped
>>
>>103614725
In his office shuffling his deck of space cards.
>>
>>103615195
How is the day 21 drop so low? Are you counting the people who solved it late?
>>
File: frieren.png (476 KB, 700x700)
476 KB
476 KB PNG
>>103614725
"...Himmel the hero loved Advent of Code puzzles."
>>
>day 25 part 1: press the button if you have 23 stars
>day 25 part 2: press the button if you have 499 stars
>>
>>103615264
Damn that would be kino
>>
>>103615264
Kino
>>
>>103615264
Damn, I will be 359 stars short
>>
>>103615349
still have a few days anon
>>
>>103615264
This would filter me, but I hope it happens. It would be fitting considering the anniversary theme.
>>
>>103615438
I am not doing all aoc in three days, but I will probably try doing it before the next AoC starts.
>>
>>103615471
It's not as fun without you faggots
>t. 232 stars
>>
>>103615471
I did some of the past years when it wasn't december, but I agree, it wasn't very fun. It was mostly something for me to do when I didn't have a job.
>>
>>103615264
sitting at 431 stars right now
even if there isn't a 499 stars requirement this year, I really should go back and finally run the home straight
>>
Gaaawd you guys are STILL doing this??? Wow. Imagine if you had spent this time learning how to create PRODUCTION QUALITY software. Sheeesh. Enjoy those toy programs though.
>>
>>103615210
>>103615211
I'm talking shit it's not padding, the black background, title and days are missing.
>>103615224
>Are you counting the people who solved it late?
yes
>How is the day 21 drop so low?
the must have been filtered yesterday
>>
>>103615747
i have a real job and 80% of my coworkers already got filtered
>>
>>103615747
>PRODUCTION QUALITY software.
You mean like the idiomatic rust guy?
>>
>>103615758
I’m jealous. I can’t even get any of my coworkers to participate in the first place.
>>
Goodbye, Advent of Code – Why I'm Too Good for This

After much contemplation, I've decided to walk away from Advent of Code. Here's why:

Production Quality Software is My Forte: Let’s be honest, Advent of Code is child’s play. I pride myself on writing top-notch, production-ready code. These puzzles? They encourage quick and dirty solutions that are beneath me. I’m all about meticulous testing, elegant design, and scalability—traits this contest sorely lacks.

My Time is Far Too Valuable: The daily puzzles are an utter waste of time. I have more important things to do than spend hours on trivial challenges that offer no real-world value. My time is precious, and I refuse to let a glorified coding contest dictate my schedule.

I’m Above Meaningless Challenges: There are countless impactful projects that deserve my attention. Open-source contributions, groundbreaking software development, and personal ventures that can actually change lives—these are worthy of my skills. Advent of Code? It’s a distraction from the real work that matters.

The World Has Moved On: It’s 2024, people! The tech landscape has evolved dramatically in the past decade. AI, quantum computing, and innovative solutions are where the future lies. Advent of Code feels outdated, a relic of a simpler time. I’m ready to embrace the future, not waste my time on past relics.

I respect those who find joy and growth in Advent of Code, but it’s clear this challenge is beneath me. I’m moving on to bigger and better things that align with my passion for creating exceptional software.

Thanks for understanding and happy coding to all.
>>
>>103615747
I don't write code for a living because it's a dying field that's going to be replaced by LLMs. I do these challenges for fun.
>>
>>103615875
Unsubscribed.
>>
>>103615875
I want to believe this is a reddit colypasta
>>
>>103615195
fixed.
the recent pip install must have conflicted with the existing pacman install
>>
>>103615901
Slop, but it may as well be.
>>
ONE HOUR
>>
>>103615929
The Wall Cometh
>>
>>103615875
LLM Slop so distinctive, but I can't point to why.. maybe it's the listicle format?
>>
NO FILTER TODAY
>>
File: 1731981884695629.jpg (12 KB, 225x225)
12 KB
12 KB JPG
Today is tetris. book it
>>
>>103615929
Today is back to our VM.
>>
Cellular automata tonight
>>
File: zd15.png (39 KB, 888x875)
39 KB
39 KB PNG
I found some code I wrote from 2021 when I only knew how to code for a year and this shit is painful to look at
>>
File: zd19.png (31 KB, 722x659)
31 KB
31 KB PNG
>>103616086
the infamous beacon problem
>>
File: smug.png (245 KB, 420x385)
245 KB
245 KB PNG
>>103616086
>comments
>>
>>103615951
The only wall is the one in my heart that prevents me from engaging in the joy of programming as I once did as a child.
>>
>>103616020
The output of large language models (LLMs), often referred to informally as "llmslop," is distinctive due to several factors:

1. High Dimensionality: LLM outputs reflect an intricate balance of probabilities across vast vocabularies, capturing subtle nuances of human language that smaller models or simpler systems often miss.

2. Contextual Sensitivity: LLMs generate outputs by understanding and maintaining context over long sequences, allowing for coherent, nuanced, and contextually appropriate responses.

3. Training Scale: They are trained on massive datasets spanning diverse domains, making their output rich and often unexpectedly insightful, even in niche or creative contexts.

4. Stochastic Creativity: LLMs often introduce slight randomness (via temperature, top-k sampling, or nucleus sampling) in their output, which can result in unique phrasing or ideas that mimic human creativity.

5. Subtle Errors: While LLMs excel at producing fluent language, their errors (or "slop")—like subtle misinterpretations or overgeneralizations—can make their output stand out as distinctly "AI."

6. Emergent Behaviors: LLMs demonstrate abilities, such as summarization, translation, or reasoning, that are not explicitly programmed but arise from their scale and architecture.

These factors combine to make the outputs of LLMs uniquely impressive, versatile, and occasionally unpredictable.
>>
>>103616113
nah, it's none of that stuff
>>
>>103616020
It falls into a monotonous cadence because it's been told by the system prompt to be "helpful" and "explain things".

You'd write the same way if you were trying very hard to be explicitly clear and sincere.
>>
>>103616097
>*(rule[i]//abs(rule[i])
new sign function just dropped
>>
>>103616086
It doesn't look bad?
>>
>>103616020
Each word is the highest probability continuation of the preceding text.
This means that the informational content is exceptionally low, much lower than a real person. Just like the LLM functions by predicting what it will say, you can also predict what it will say. There's no cognitive texture, no entropy, no surprises
>>
>>103616216
That's why it's so useful as a search engine, but not great for trying to fool other humans.
>>
>>103609908
Pretty sure the rust guy is a literal troon from the state of Georgia who is a janny on /lgbt/
>>
>>103616237
>janny on /lgbt/
tell her to stop deleting the diaper threads
>>
>>103616237
>rust
>troon
name a more iconic combo
>>
File: 1727653353223614.jpg (23 KB, 300x300)
23 KB
23 KB JPG
>program works on input but gives wrong answer on bigboy
>>
>>103616216
You can fix this by trivially changing the "temperature" parameter but absolutely no company is ever going to do that, so the only option is self-hosted if you want an AI that says nigger or whatever.
>>
>>103616113
>LLM actually kissing its own ass
>>
>>103616259
bigint?
>>
File: 1732118396656891.jpg (75 KB, 1574x904)
75 KB
75 KB JPG
>>103616265
>tfw your answers are distinctive because you're too high IQ for them to not be
>>
>>103616275
this is on part 2
>>
just took a huge dump
>>
I just want you all to know that I love spending Christmas with you guys.
>>
>>103616237
nice fanfiction, dumb retard
>>
i have an interview tomorrow, i have no more time for kiddie puzzles
>>
>>103616328
are there other types of retards?
>>
TEN MINUTES
>>
File: 1733654980642328.jpg (102 KB, 580x500)
102 KB
102 KB JPG
For all my fallen brooters, I will carry the torch
>>
>>103616327
I don't know how I'll manage next year when there's no AoC...
>>
>>103616328
nah im correct
>>
File: pepecheers.gif (345 KB, 500x500)
345 KB
345 KB GIF
The great filter is coming.
>>103616349
Imagine having to work. LMAO
>>
>>103614204
CUTE!
>>
>>103616375
he's trolling, no one does interviews on christmas week
>>
File: konata-computer.jpg (159 KB, 1336x1112)
159 KB
159 KB JPG
any aoc++ leakers in chat?
>>
>>103616359
The brootbros are still all brootin
>>
dijkstra today
>>
Brootbros its looking good today
>>
>>103616384
grid + pathfinding thank me later
>>
File: showtime.jpg (46 KB, 640x480)
46 KB
46 KB JPG
https://www.youtube.com/watch?v=hjGZLnja1o8
>>
>>103616400
cancer music
>>
>>103616400
kino music
>>
>>103616400
cancer music
>>
>>103616400
kino music
>>
>>103616402
kino poster

>>103616403
cancer poster
>>
File: showtime-frog.png (468 KB, 1858x1829)
468 KB
468 KB PNG
>>103616400
>>
File: mokou-showtime.jpg (130 KB, 440x518)
130 KB
130 KB JPG
>>
File: 1733201676061642.png (453 KB, 1858x1829)
453 KB
453 KB PNG
showtime
>>
>>103616411
cancer image
>>
File: 1717066012009032.jpg (190 KB, 1280x720)
190 KB
190 KB JPG
Tonight's the night!
>>
>>103616400
SHOWTIME
>>
>>103616389
>>103616398
I believe it
>>
>>103616400
IM CUMMING
>>
File: 1734049098627379.jpg (110 KB, 368x468)
110 KB
110 KB JPG
>>103616420
>>
game of life with a twist tonight
hope you remember how to do convolutions in your language
>>
>>103616430
import np and pray
>>
graph partitioning tonight
>>
cycle
>>
FUCK
>>
FUCK I'M POOPING
>>
FUCK
>>
FUCK
>>
FUCK
>>
advent of graphs
>>
>another ez pz llm sweep
>>
File: peeandpoop.png (233 KB, 1750x1042)
233 KB
233 KB PNG
advent of networkx continues
>>
I just did import solution in python
>>
File: 1727417805456169.png (85 KB, 1062x878)
85 KB
85 KB PNG
I didn't solve it
>>
File: D23.png (737 KB, 1936x3352)
737 KB
737 KB PNG
Unwashed Kotlin.
>>
Claude wrote a bron kerbosch function for me. I feel dirty...
>>
>tried to think of a smart way to do part b
>give up and BROOT instead
now we wait
>>
>>103616564
>>103616566
>>103616576
how the fuck am I supposed to get hints if you just import solution
>>
>>103616632
BronKerbosch2(Ø, {1,2,3,4,5,6}, Ø)
BronKerbosch2({2}, {1,3,5}, Ø)
BronKerbosch2({2,3}, Ø, Ø): output {2, 3}
BronKerbosch2({2,5}, {1}, Ø)
BronKerbosch2({1,2,5}, Ø, Ø): output {1,2,5}
BronKerbosch2({4}, {3,5,6}, Ø)
BronKerbosch2({3,4}, Ø, Ø): output {3,4}
BronKerbosch2({4,5}, Ø, Ø): output {4,5}
BronKerbosch2({4,6}, Ø, Ø): output {4,6}
BronKerbosch2({6}, Ø, {4}): no output

hint, I guess.. seems like a "know the algorithm or don't" problem
>>
File: 1726258123335249.png (33 KB, 440x284)
33 KB
33 KB PNG
>>103616640
>>
>pretty sure my logic is correct
>That's not the right answer
ummmm uh oh.
>>
I finally finished Part 2 of the robot numpad problem. I got filtered. Haven't been to the thread because I didn't want spoilers until I could do my late work. I still don't understand why >^ is better than ^>, but it works, so I will clear it from my mind now. In hindsight it seems easy since it was just djikstra's + the blinking rocks again.
>>
tomorrow is the last chance for a hard day the final day is always ez (hoping for a medium)
>>
This is day 3 tier puzzle.
>>
>>103616632
>how the fuck am I supposed to get hints
Hint: calculate the maximum connectivity of one computer.
>>
>>103616659
but wat if u choose the wrong one
>>
>>103616653
>>pretty sure my logic is correct
>>That's not the right answer
You are probably only trying one best-fitting candidate, but there are many with the same fitness.
>>
>>103616662
It doesn't matter, you will have the upper bound for the clique size.
This is an NP-hard problem, btw, so the solution can only be found if your input has some hidden properties (max connectivity is this property).
>>
File: shoot_2024-12-23_00:38:56.png (284 KB, 1223x1713)
284 KB
284 KB PNG
>>103616665
no I got it. It was just a stupid thing i wasnt considering.

I solved it with induction where i just grew the triplets until they were as big as I could get them, then took the best one.
What is the real way?
>>
File: carbon.png (109 KB, 849x771)
109 KB
109 KB PNG
>>103616576
Same

      -------Part 1--------   -------Part 2--------
Day Time Rank Score Time Rank Score
23 00:21:07 2321 0 00:29:48 1266 0
>>
>>103616685
Also nice day 23 puzzle eric. Looks like day 21 will be the hardest one. It was ok, but this was a weak year overall.
>>
File: carbon(67).png (292 KB, 1724x1430)
292 KB
292 KB PNG
I solved the first by hand but for the second I imported solution.
>>
File: d23.png (145 KB, 960x1751)
145 KB
145 KB PNG
We're having a lan party bros.
>>
This one felt the most like an interview leetcode problem.
What is the name of the algorithm you are supposed to know here?
>>
>>103616716
hashmaps

Today was easy, maybe I should finish day 21 part 2 and unfilter myself...
>>
File: xarbon.png (12 KB, 452x708)
12 KB
12 KB PNG
I was thinking about an algorithm for 20 minutes when I realized I can just brute this because maximum degree is 13. Fuck you eric
>>
BronKerbosch as implemented by ChatGPT tells me that co ta ka de is one clique.
>>
Bros, I saved days 21-23 because I have a 1 day workweek tomorrow and am slacking off 100% of the day. Can I get them all done in 7 hours
>>
File: carbon.png (196 KB, 1206x1016)
196 KB
196 KB PNG
      --------Part 1--------   --------Part 2--------
Day Time Rank Score Time Rank Score
23 00:28:13 2910 0 00:42:56 1943 0

>>103616713
Same
Feeling extra retarded today.
>>
>>103616744
21 is the hardest this year. 22 and 23 are easy day 3 problems.
>>
>>103616716
https://en.wikipedia.org/wiki/Bron%E2%80%93Kerbosch_algorithm
>>
>>103616744
oh boy you picked the wrong one to save
>>
>>103616744
>d21
I'm sorry.
>>
kek look at who we got on part two place 100
He's back again but probably only started the script at 6:05
>>
File: 1733291385590633.png (39 KB, 150x150)
39 KB
39 KB PNG
I am withholding my AoC++ donation this year because the tyrannical subreddit rubs me the wrong way.
>>
motherfucker I managed to read
>Connections aren't directional
as meaning that they WERE directional
as, obviously non-directional would be the expectation, so if Eric's emphasizing a point, it must be an unusual point, right?
>>
>p2 rank 122
FUCKING WASP MADE ME RUN AROUND FOR A FULL MINUTE
>>
File: weak.jpg (37 KB, 462x431)
37 KB
37 KB JPG
is this year the easiest of all time?
>>
>>103616795
filtered by reading comprehension
>>
part 1: identifying cycles with dfs
part 2: iteratively building interconnected sets of size 1, size 2, size 3 etc...
>>
>>103616796
>wasp
just ignore it bro, it's a wasp
it's something genuinely annoying like a moth
>>
>>103616772
any of you actually willing to bet your life that he's cheating
>>
>>103616744
I hope you don't mind DP
>>
>>103616799
yes. With the exception of day 21 I didn't struggle at all, and my solutions were even quite fast. Most years there are 2-3 puzzles that have complex states that I have no idea how to reduce to proper datastructures, and I end up implementing a shitty broot and prune it until It runs in under 10 minutes, and just barely squeak by unfiltered.

I guess d21 fits that for this year. But compared to other years it really wasn't that bad. other than d21, I instantly recognized how to transform each puzzle into a trivial, sterile 'leetcode' puzzle. They were not unique or fun at all. eric has given up.
>>
Day 1 tier puzzle.
import { readFileSync } from "fs";

const input = readFileSync("./input", "utf-8").trim();

/** @param {string} input */
function parseInput(input) {
/** @type {Map<string, string[]>} */
const connectionsMap = new Map();
input
.split("\n")
.map((line) => /** @type {[string, string]} */(line.split("-")))
.forEach(([from, to]) => {
if (!connectionsMap.has(from)) {
connectionsMap.set(from, []);
}
connectionsMap.get(from).push(to);
if (!connectionsMap.has(to)) {
connectionsMap.set(to, []);
}
connectionsMap.get(to).push(from);
});
return connectionsMap;
}

/** @param {ReturnType<typeof parseInput>} input */
function part1(input) {
const visited = new Set();
input.forEach((tos, from) => {
if (!from.startsWith("t")) return;
tos.forEach((to1) =>
tos.forEach((to2) => {
if (to1 === to2) return;
if (!input.get(to1).includes(to2)) return;
visited.add([from, to1, to2].sort().join("-"));
}),
);
});
return visited.size;
}

/** @param {ReturnType<typeof parseInput>} input */
function part2(input) {
let biggestSet = [];
input.forEach((tos, from) => {
const set = [from];
tos.forEach((to) => {
if (set.every((from) => input.get(from).includes(to))) {
set.push(to);
}
});
if (set.length > biggestSet.length) {
biggestSet = set;
}
});
return biggestSet.sort().join(",");
}

console.log(part1(parseInput(input)));
console.log(part2(parseInput(input)));
>>
>>103616747
i refuse to believe 2000 people know this random fucking algorithm and didnt just chatgpt it
>>
>Had a backtracking way to do part 2 ready to go
>Forgot to add a visited cache
fuck, my time could have been so much better.
>>
>>103616839
What algorithm? Naive solution works perfectly.
>>
>>103616846
not picking every combination of group size N and checking it though
>>
>>103616839
>study CS at university
>take algorithm and data structure courses
>learn all about cliques
>read aoc today
>cliques
I just did a quick and simple import solution
>>
>>103616839
>random fucking algorithm
>if computer isnt in lanparty, see if every computer is connected to it and add it
wow only the smartest of algorithm knowers could have possibly figured that out.
>>
>>103616839
You niggers are overestimating cheatgpt usage
Out of the initial 200k participants if even a small fraction were cheaters we would have sub 20 second solves filling up the leaderboard pretty much everyday
>>
File: 1727572894753331.png (511 KB, 1812x1212)
511 KB
511 KB PNG
>>
>>103616855
Naive, not retarded on purpose.
>>
>>103616819
Unironally some people just have different skillsets so no
>>
>>103616788
Eric will close AoC anyway.
>>103616839
You don't need to know the algorithm.
There is a naive solution that works:
>Get the max degree
>Find all vertices with this degree
>Find maximum cliques for each of the subgraphs connected to such vertex
>>
File: file.png (238 KB, 1654x1198)
238 KB
238 KB PNG
literal baby shit, fuck eric
>>
>>103616880
does this work? imagine if there were a computer with 10000 unique connections. and then 3 off to the side only connected to eachother. The algorithm would fail as you would only check the node with 10000 connections.
>>
>>103616866
What a shitty lanparty.
I want to cut just three of those links.
>>
File: day23-mathematica.png (1.01 MB, 1723x1426)
1.01 MB
1.01 MB PNG
Well I wish I'd started today early, I could have probably beat the LLMs.
>Purchase solution
>>
>>103616891
>does this work?
Yes, on the AoC input. The general case does not matter, it's an NP-complete problem.
>>
AoC++:
Every computer is a dot on a 26x26 grid with latin characters as coordinates (in alphabetical order, "ba" is (1, 0)). Find the shortest path that visits a computer in each clique (you can't move diagonally).
>>
>>103616918
Back when AoC was good, Eric would have included this edge case in the input, and there would be funny seething in this thread. Edge cases make redditors sad or something, so we don't get any anymore.
>>
>>103616912
SAARRR ITS ONLY 200 A MONTH SAAR
>>
>>103616920
>grid
Stopped reading there
>>
>>103616934
do you think sam altman is indian or something?
>>
File: carbon.png (573 KB, 1750x2680)
573 KB
573 KB PNG
lazy day
>>
>>103616951
Every day has to have a grid. If it doesn't have a grid in part 1 and 2 it will have a grid in part 3.
>>
Due to Eric Giving Up. After this year I will no longer be using python and trying to get good times at midnight. I will graduate to using a memelang and making my own fun that way. Solving without self imposed restrictions is just boring leetcode now.
>>
>mfw i realised something i did as a mistake actually ensured i got the correct result
>>
File: image.png (122 KB, 600x2134)
122 KB
122 KB PNG
Very unwashed, very hastily improvised ... but still simple.
>>
ChatGPTs BronKerbosch runs out of RAM...
>>
>>103616997
Claude's worked fine for me
>>
sigh. not even a hard day. not happy with my times today.
doing set shit in golang is just shit. I assume its like a 10-20liner in python.
Day       Time   Rank  Score       Time   Rank  Score
23 00:41:09 3639 0 01:26:43 3452 0


    comps := make(map[string]map[string]struct{})
// compsinv := make(map[string][]string)

for _, vs := range strings.Split(string(dat), "\n") {
vs = strings.TrimSpace(vs)
if len(vs) <= 0 {
continue
}
ss := strings.Split(vs, "-")
// comps[ss[0]] = ss[1]
v, ok := comps[ss[0]]
if !ok {
v = make(map[string]struct{})
}
v[ss[1]] = struct{}{}
comps[ss[0]] = v
v1, ok1 := comps[ss[1]]
if !ok1 {
v1 = make(map[string]struct{})
}
v1[ss[0]] = struct{}{}
comps[ss[1]] = v1
}
fmt.Println("comps", comps)

ssets := [][]string{}
for a, v := range comps {
tset := []string{a}
for k := range v {
tset = append(tset, k)
}
sort.Strings(tset)
ssets = append(ssets, tset)
}
umap := make(map[int]map[string]int)
for i := 0; i < len(ssets)-1; i++ {
for j := i + 1; j < len(ssets); j++ {
is := ssets[i]
js := ssets[j]

union := funion(is, js)
ulen := len(union)
um, ok := umap[ulen]
if !ok {
um = make(map[string]int)
}
um[strings.Join(union, ",")] += 1
umap[ulen] = um
}
}
fmt.Println("umap", umap)
mnodes := ""
mcmax := 0
for ncount, nodesc := range umap {
for nodes, ecount := range nodesc {
if ecount == (ncount*(ncount-1))/2 {
fmt.Println("got", nodes)
if ncount > mcmax {
mcmax = ncount
mnodes = nodes
}
}
}
}

fmt.Println(mcmax)
fmt.Println(mnodes)
}
func funion(a []string{}, b []string{}) []string{} {
s := make([]string{}, 0)
h := make(map[string]struct{})
for _, v := range a {
h[v] = struct{}{}
}
for _, v := range b {
if _, ok := h[v]; ok {
s = append(set, v)
}
}
return s
}


>>
>>103616971
AoC in shaders would be fun.
>>
>>103617004
can you check if claude can solve day20? for >>103585761
inb4 they actually paid 200$ a month for o1 pro
>>
File: 23.png (1.8 MB, 1740x4178)
1.8 MB
1.8 MB PNG
Really fucking ugly unwashed C++ ass. Part 2 was surprisingly easy to brute force. Could probably clean up to use Part 2 logic for Part 1 instead of my dumb DFS logic.
>>
>>103617036
i don't think so, i remember trying to get him to help me with my program and he didn't do a very good job
just now i prompted him to 0shot it and he came up with https://pastebin.com/raw/0DgHAEkk - this runs for over a minute without a result on my input, not sure if it will ever finish
>>
File: D23_washed.png (438 KB, 1970x1676)
438 KB
438 KB PNG
Washed Kotlin.
>>
>>103617058
Does asking it to come up with a more efficient solution solve it? If not, I'm sure telling it to use Manhattan distance would.
>>
>>103617076
ill give it to them if they actually knew how to solve the question and just used LLM to write the code faster desu. thats better than most llm jeets
>>
>spend 30mins writing p2 that finds the largest chain
>realise it's a supposed to be the largest chain where everything connects everything else and not the largest loop of single connections
I'm filtering myself at this point
>>
File: mean.jpg (166 KB, 1170x1181)
166 KB
166 KB JPG
Are we ever going to get a math day?
>>
>>103617129
The crane day was a math day. An easy one, but a math day nonetheless.
>>
>>103617101
Same
I started to write dfs to find the longest path between computers, then I thought that I probably need a largest tree instead and then I decided to read the problem again.
>>
>>103617129
Its over. We didn't get
>Tree day
>cellular automata day
>cycle day
>100000 rule simulation edge case wall of text day
>fun day
Eric has given up
>>
>>103617133
The claw?
>>
>>103617141
Christmas tree was a fun day.
>>
>>103617150
That is true, That was a good day.
>>
>>103617129
>Are we ever going to get a math day?
Day 17 was a math day.
>>
>>103617146
Yeah, claw game/crane game day
>>
>>103617146
day 13
>>
File: img-2024-12-23-08-04-56.png (1.68 MB, 5600x5402)
1.68 MB
1.68 MB PNG
idiomatic Rust solution
>>
Tomorrow is the 3D block day... right?
>>
strange difficulty progression this year
d, y = {}, 0  
for i, j in map(lambda k: k.strip().split("-"), open("input")):
d[i], d[j] = d.get(i, set()) | {j}, d.get(j, set()) | {i}
q = {(frozenset([i]), i) for i in d}
while len(q) > 1:
q = {(frozenset(k|{j}), j) for k,i in q for j in d[i] if j < min(k) and k <= d[j]}
y += sum(len(k) == 3 and "t" in "".join(k)[::2] for k,i in q)
print(y, ",".join(sorted(min(k for k,i in q))))

>>
>>103617194
anon.... I don't think we are getting a 3d block day....
>>
>>103617086
100% of cheating is cheating
1% of cheating is also cheating
>>
File: 1653157503779.png (856 KB, 1241x866)
856 KB
856 KB PNG
>>
>>103617272
>only 2 days left
>one of them will be another 2d grid maze
>>
File: bqn.png (112 KB, 963x859)
112 KB
112 KB PNG
long bqn, the kind of unwashed that'll get the cops called
84s runtime and 21MB max RSS
>>
File: image.png (401 KB, 863x563)
401 KB
401 KB PNG
my humble BQN solution for day 23.

pretty basic stuff. didn't clean it much. runs slow, around 10 seconds. i bet there's some nice array solution that uses adjacency matrix or whatever and is super fast.

also, i think gold can be done with union-find? never used union-find before so i'm thinking i'll try it out later.
>>
>>103617141
You must not have been participating at all
>>
>>103617322
I don't think it can be done with union-find since it doesn't have any concept of degree, it just tracks connected sets. And the best-known algorithms for this problem are exponential.
>>
>>103617178
yay, more unreadable tranny puke!
>>
>>103617287
>only one
lol lmao even
>>
>>103617272
literally me
>>
>>103617287
>Day 25
>Silver: Look at the calendar. Find the shortest cycle going through all stars (*).
>Gold: Same task, but now some characters (|, \, /, -) allow you to travel instantly between the connected positions.
>>
>>103617407
>day 25
>2 tasks
DUR HUR IM A RETARD
>>
Now that the dust has settled, is this the worst year?
(note: I havent tried 2020 yet)
>>
>>103617425
It had about 3 good problems, just like most years
>>
>>103617425
>(note: I havent tried 2020 yet)
The sea monster map (day 20) filtered a lot.
>>
>>103617540
Looks fun, It doesn't look too bad to just broot part 1, but i'm sure part 2 makes you do it properly. I'll be looking forward to it, ive seen it referenced many times as a hard problem.
I started in 2021, and I am doing the backlog chronologically from the beginning and am only halfway through 2016.
>>
Guys, am I filtered if for day 22, I submitted my solution an hour late (25 hours after it was posted)? I was busy.
>>
>>103617585
trying to get out of doing the last few days, eh?
you're not filtered. You're stuck here.
>>
yes i copy pasted a solution
no i am not filtered
write better puzzles
>>
>>103617619
weak bait. you could do better.
>>
File: file.png (82 KB, 629x1098)
82 KB
82 KB PNG
>>103617627
>>
>just find all cliques in a graph idk
Today's problem feels like Eric burned out on making puzzles.
>>
I missed the last couple threads. Is there a better way to do day 22 than brute force? For each monkey, the first time I encounter a series of four differences, I increment a dictionary by however many bananas it would be worth. Do this for all monkeys, then whatever is the highest value in the dictionary is the answer.

But surely there's a cool math way to do it right?
>>
File: 1714410454856805.png (2.28 MB, 1000x2545)
2.28 MB
2.28 MB PNG
washed I guess
>>
>>103616832
Wait, I just realized my solution doesn't even work, I just got lucky with my input
>>
>>103617675
Randomize it and call it a "probabilistic algorithm"
>>
>>103617663
>But surely there's a cool math way to do it right?
No.
>>
So we had one hard problem the whole month. Will day 24 be the final filter, or another grid traversal problem?
>>
File: carbon (15).png (103 KB, 949x720)
103 KB
103 KB PNG
>>103617699
Damn. Oh well, glad I didn't spend too long thinking about it.

Anyway here's day 23 washed (brute force again lel).
>>
File: 24_D23_C#.png (712 KB, 2548x3126)
712 KB
712 KB PNG
2.8s on my c# solution
>>
>>103617701
Tomorrow will be our VM again. I believe.
>>
>>103617663
You could precompute a differences:price map for each of the 2^24 possible monkeys. It should be about 85GB compressed.
>>
Why does it feel like 90% of aoc problems are solvable with DP, memoization, and hashmaps?
>>
>>103617574
iirc, part 1 is easier than it sounds, because the edges used for aligning the grid are unique, there's no way to snap a jigsaw piece in the wrong place.
Part 2 for that one makes you use the grid produced by part 1 for a basically completely different problem.
>check my own times for that day
      -------Part 1--------   -------Part 2--------
Day Time Rank Score Time Rank Score
20 00:39:29 837 0 06:59:24 2022 0

holy shit wtf took me so long, there's no fucking way that would take me more than an extra hour to write now
>>
>>103617733
Because that's how you solve 90% of computing problems.
>>
>>103617715
>>103617322
>>103617289

I just measured it: My brute foce Python solution takes 73 microseconds on an old and slow laptop.

>>103616984
>>
>go back to do previous years
>all your times are “>24hrs”
>all your ranks are 5-6 digit numbers
After only doing AoC live for the past 5 years I have gotten used to real times and ranks.
>>
>>103617775
>microseconds
you sure about that?
>>
>>103617802
edu:~/advent_of_code/23$ time ./program.py 
1000
cf,ct,cv,cz,fi,lq,my,pa,sl,tt,vw,wz,yd

real 0m0,055s
user 0m0,050s
sys 0m0,005s
>>
>>103617833
yeah, that's 55 milliseconds
>>
>>103617841
Oh. Sorry, you're right.
>>
>>103617833
holy based retard
>>
File: 1733418151013505.png (223 KB, 693x633)
223 KB
223 KB PNG
>>103617851
Yes, but the solutions for the 2 puzzles were correct.
>>
Programmers are often off by one, engineers by magnitudes.
>>
File: pjt.png (150 KB, 557x438)
150 KB
150 KB PNG
>>103616953
Saar, don't be a poor fag. Saar.
>>
      -------Part 1--------   -------Part 2--------
Day Time Rank Score Time Rank Score
23 03:58:23 8509 0 04:11:26 6606 0

FUCK I OVERSLEPT AAAAAAAAAA
Anyway, cool day. Spent a stupid amount of time trying to do Tarjan's algorithm for each part because I lack reading comprehension. Then did Bron-Kerbosch for part 2.
>>
>>103608634
thanks eric for this np-complete problem, brooters will be happy today
>>
I have officially burnt out.
I know what I have to do for day 11 GBA, but I haven't even started it. The main thing is having to split numbers, which will require going from binary back to BCD to measure length and decide whether split.
But, those numbers will turn up over and over, so caching which numbers will require splitting and the results will reduce the amount of conversions that'd have to be done. And then I just need two sufficiently sized blocks of memory to alternate between.
>>
Fucking networkx carrying me through my phonecoding
I was hoping to do importless but God forbid i have to code my own clique algorithm on a phone
>>
MY BRUTE TOOK OVER THREE HOURS AND IT WORKED
>>
>>103616839
nigga, if you ever touched graphs, you'd be realize instantly it's cliques
>>
File: 1581289735126.png (573 KB, 1260x2888)
573 KB
573 KB PNG
>>103617675
>>103616832
Still easy, but I am a retard for writing the shit above.
>>
>>103616839
>>103616715 here, what algorithm?
>>
>>103618074
ive never heard of cliques before
>>
>>103618081
Still don't need to learn some fucking algorithm btw, just common sense.
>>
>>103618098
If you'd studied any computer science or math, you would have
>>
>>103616839
The funny is that all nodes have the same amount of edges, so naively checking edge lists for the largest clique works all the same
>>
>>103618098
I haven't either, but it's still an easy problem:
You keep a hash set of visited computers and a hash set of hash set that denotes to which computers any computer is connected to. Then for each pair of computers you haven't visited yet, treat that as an initial set. Determine the set of computers they are connected to and check for each member of the connected-set if they are connected to each member in the initial set. If yes, add it to the initial set and repeat the process until no further computer can be added.
For the gold answer, find the biggest of those sets, simply arrange the computers alphabetically and print them out.
>>
>>103618098
Anon, just google it:
1. google graph theory find largest fully connected sub graph
2. https://stackoverflow.com/questions/2801138/find-all-complete-sub-graphs-within-a-graph
3. https://en.wikipedia.org/wiki/Bron%E2%80%93Kerbosch_algorithm
That's it, simple as.
>>
>>103616984
I think that "greedy" approach might be fast, but is not guaranteed to work. you might add a pc to the party that just happens to be connected to the first couple of pcs but that "poisons" the whole party by missing a connection later on.
>>
Shitty explanation of my method today:
>when initially iterating through the lines, store each pair as: p1: [p2] in a map, such that p1 is the first key and p2 is the second. p2 is put into an array as the value of p1. also store the reverse, p2: [p1]
>for each line, if the key exists append it to that array otherwise initialize it
>also store all 1:1 relations, forwards and backwards in a hashmap for easy lookup (ab-cd and cd-ab)
>iterate through every group in the initial map
>for every key, go through it's array and compare every pair against each other (compare i to i+1,i+2,i+3, then i+1 to i+2,i+3, etc)
>for each time there's a match, store this as a 3 length chain for use in silver
>before going from i to i+1, check all times i actually did have a match with any i+n value
>for each i+n value check it against each other in the sub group that was created, if it doesn't match even once then delete it from the sub group and move on
>check if this sub group's length is the largest recorded so far, if so store it
I don't know what sort of algorithm you're supposed to use for this kind of thing but it worked for me at least.
>>
File: carbon (12).png (313 KB, 1818x1470)
313 KB
313 KB PNG



[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.