the last stand 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:224303-2c132471anonymous-only leaderboard:383378-dd1e2041Previous thread: >>107511264
i am declaring a jihad against eric
>>107515633faggot image that has nothing to do with aoc or crymas
irc for organising bonus puzzles: #aocg on rizonno client? webclient here: https://rizon.net/chat, type /join #aocg
idiomatic Rust solution
straightforward python solution
Anyone wanna test my puzzle?
>>107513786>>107513817>>107515653>picrellol so shameful
>>107515682yes if you agree to test mine
wait a second, the problem sounds relly familiar, at least part oneI think you can import solution from previous editions
import solution
>>107515667>irc>email list>discordits too muchcoordinate your efforts
>>107515657that's not very nice :(
>>107515705i have only suggest irc, anoni would also accept email, but discord is off limits
>>107515682domatino[at]proton[dot]megot filtered on 9.2 and 10.2 tho
>>107515716neither is your random ass image of persians and spartans or whatever the fuck it is
>>107515760nigger it is a literal last stand
>make thread too early>use a non-comfy non-christmas imageyou had one job OP
>>107515773im sorry
>>107515807don't make excuses, make a puzzle to make it up to it
>>107515892i did it's being beta tested rn. will probably put it up day after or the day after day after. need ideas on how to distribute solutions though
cycles cycles cycles ack! this shit eats up all my ram in a second saving visited! how does topological sort solve this? I get that it can help find 1 possible ordering, but the goal is to find all total?
>>107515938
>>107515690yidahot467@roastic.comSend it
>>107515916- upload inputs to 0x0.st:curl -F'file=@input.txt' https://0x0.st- share answers as sha256- write the problem statement and examples- attach a cute picture
curl -F'file=@input.txt' https://0x0.st
>>107515938>how does topological sort solve thisit doesn't
is last day always Part 1 + free star if you have the rest?
>>107516006yes but that was before he moved to 12 days so who knows nowprobably still the case though
>>107515916I think 1 input with spoilered solution is fine until someone makes infrastructure.
What's the minimal way to host an AoC-style puzzle?>load page>seed is set randomly>get puzzle input based off seed>when you submit your answers the seed gets attached to the request>can manually change seed to get new inputsOr I could dump all the input-solution pairs as text files and you check yourself. Or does that lack sovl?
>>107516006Yes and there are always 25 days
>>107516029>until someone makes infrastructure.some github.io link/0..9 for ten different inputscorrect answer decrypts part two and you collected both stars pages, wrong answer shows gibberishno cookies no nothinghow hard could this be to make?
>>107516059In theory, this would work, but it would probably make users mad, it's better if you keep track of user sessions with ids and generate a seed based on their id
>>107516074This has the same energy as "I'll make the logo".The hard part is creating good puzzles.
>>107516074>ten different inputsThat only makes sense on 4chan. These faggots want to post it on reddit too
>>107516096>puzzles>pluralall you gotta do is one puzzle on the 13th to remember the good old times and that's it
>expect p2 to be instantly solved>it's been running for two minutesI'm in trouble, huh?
>>107516059>dump all the input-solution pairs as text filesif you make the solution available before the problem is solved then that suddenly makes it less funif you went that route this year (given time is running out) then make sure the solutions are huge and dump them as sha256
>>107516148>make sure the solutions are hugenot sovl
>>107516096i've conceived a puzzle, respond to this with an email id so I can send you the beta test materials. its open for a couple people so i can iron out any flaws that might pop up before revealing to a wider audience
>>107516216yuraf4g@proton..etc
>part 2>answer too high>gave correct answer for test>gave correct answer for custom edge case>gave correct answer for more custom edge cases>gave correct for even more tests>check part 1 answer again>gives incorrect answer for part 1>gru_doing_a_double_take.png>read the puzzle text again>I have been somehow submitting my answers for the past 1-2 hours to yesterdays input boxoh my godI can go back to trying to unfilter (rip) myself on yesterday again now
DAY 13 PUZZLE: OPEN BETApuzzle text: https://files.catbox.moe/9xrzxq.mdinput: https://files.catbox.moe/ftkt2q.txtsolution sha256:>pt1: 2747b7c718564ba5f066f0523b03e17f6a496b06851333d2d59ab6d863225848>pt2: 08490295488a1189099751ebeddb5992313dd2a831e07a92e66d196ddc261777
>>107516440no
>>107516473please
>>107516440>more than 24 hours earlyis this how AoC++ chads feel all the time? its unnatural
>>107516525next year I'll throw 2 dollars at eric and ask him to shake it
>>107516440The input is the same as the example.
>>107516540beta test this is more to see if the puzzle text flows well etc
Well its the last day boys! Good luck!
>>107516547I dont like the comma inside the quotesI imagine it will have the aoc-styling in the final version so it is not "boring" white on black
>>107516566what comma>white on blackI'll probably post the puzzle text here, or make a little website for it idk. if someone could make a website and I could send them the puzzle text etc that'd be even better i'm kinda dog water at designing ui
That obon of code guy already has a website set up. We should sent the puzzles to him and he can host them at midnight? Idk how hard that is to do, surely you just check the time with a line of javascript or whatever
>>107516598>"We need to know how much ice we can extract right away,"
>>107516598I think markdown supports css so maybe you can lift erics cssbut not all markkdown viewers support it (github for example is godawful at css in markdown files)
saw this thing https://www.dbpro.app/advent-of-sqlsounds like its probably pretty basic compared to aoc but might be cool
>>107516440seems cool but I don't understand desu. the puzzle input is serveral layers? why not just use a big grid of numbers representing the levels?
>>107516632i thought this style of input was what was most visually apparent, though I could've just specified through 3d coords ig
>>107516632how are you not filtered yet?
Day 14 sneak peek(This post is available to AoC+ subscribers only, if you're not an AoC+ subscriber please don't view)
>>107516440The air only goes down, right? As in it can't fill a cave from below?Nice to see a 3D floodfill puzzle but part 2 seems a bit easy, A single should solve part 1 (if you mark ice cubes you explored) and part 2 (if you count empty cubes and subtract the filled ones). Maybe something like "how many blocks do you need to remove to connect all pockets" would make for a nice part 3?>>107516650Input is fine and saves us creating a padding ourselves, I think we had it in aoc a few times.
>>107516680Is this just dijkstra, but with six 2d arrays connected?
>>107516720i'd rather keep it two parts, and yeah your idea sounds better. only thing is I cannot conceptualize how i'd solve it beyond pathfinding from a cavity to nearest open region, hmm
>>107516651I should be desu, but with a shorter easer advent and the power of z3 I'm back baby.
>>107516801lol ya that makes sense. Literally no one was filtered by day 11.
>>107516440nice puzzle!
>>107516440It's just bfs or dfs or whatever, doesn't really sound like fun...
>>107516846python is a bad kind of autism, programming without fucking {}, hell fucking no
>>107516440I like it. Part 2 is a little simple, but a solid mid-month problem.
>>107516440I thought part 2 would be part 1 but with an ability to break 1-2 ice blocks.
>>107516440lmaooo the puzzle i was thinking of was going to be a similar 3d flood fill (mine was liquid with gravity) but with a different part 2. Still might do it if it looks like we won't make it to day 25. My instructions were getting really convoluted and I got demoralized
I have an idea for a puzzle...But I have other stuff to do...
>>107516618did everything up to current date since posting, pretty easy
>>107516867shit takebraces are really noisyt. fortran anon
>>107516867YAGNI
>>107515672why do you wear the beanie
if you're in here bro I used your answers
>>107517295because I'm balding, homie.
>>107517310you're welcome :)
>>107516440love you anon <3. not hard but full of sovltook me back to the good aoc days
>>107517310damn, his solutions peak idiomatic python.
>>107517295what beanie?
solved the GCHQ christmas puzzle :)
>>107517395tell us more about it anon
>>107515672how tf did you get recursion to work? last year I did in rust and failed to do toposort using recursion
>>107516440can i fax you an answer?
>>107515667>httpsnice virus
>>107517401it's not programming-related, just a festive puzzleone of the sub-puzzles was decoding a substitution cipher from a cribanother was finding a word within a set of country names
>>107517406you just call the function itself inside of the function, there really is nothing more to it.
>>107517451nvm I think the struggle was recursive closures. basically I wanted to avoid passing the context variables like graph, visited, etc in each call
>>107517352(Me)I kind of like grid puzzles, not allocating extra memory for the grid other than the raw input. pretty comfy desu
>>107517412if the sha matches you've pretty much got it, although I'll probably switch around part 2
>>107517501isn't the input the same as example?
It took me about 7 hours to finish part two. Part one was behaving nicely but for part two I had to learn how to do memoization. I tried so many things, half of them didn't work at all, half of them managed to handle test input but stuck at actual input. I need to learn this shit because performance compared to my attempts without it is absurd>>107513971I cannot parse paths function at all. Would you mind explaining it?
>https://files.catbox.moe/3z365u.mp4Last day! Merry Christmas /G/irls!
>>107517607how did you do day 7 without knowing memoization?
>>107517607NTA but no. of paths from "from" to "to" equals sum of no. of paths from all children of "from". base case would be if "from" == "to" then return 1 as there is a single path from that node to itself. the return 0 case is kind of nonsensical.and since a node might be visited several times following a different history of visited nodes you can just memo the paths function.see page 152 of https://usaco.guide/CPH.pdf
day 8 in haskell. a very hacked together function doing union-find. runtime is around 1-2 seconds
>>107517680at every dfs step I wrote down the result manually on my paper. then once I had all the steps written out I added them together.
>>107517705wtf I applaud your determination not to get filtered.Memoization is just saving the result in a hashmap instead of writing it on paper.
>>107517607part 1 took me 12 hours because i had to learn how to add numbers in python
>>107517680I believe I posted it to one of the threads but I did pascal's triangle, I believe that's how its called. To be honest I am not sure how you memoize that. Part 7 felt intuitive thoughHere is the codeimport Data.Matriximport Data.Maybe (fromMaybe)import Data.Vector qualified as VnumerizeInput :: Char -> IntnumerizeInput c | c == 'S' = -10 | c == '.' = 0 | c == '^' = -1inputMatrix :: String -> Matrix IntinputMatrix = fromLists . map (map numerizeInput) . linescalculateCell :: Matrix Int -> Int -> Int -> IntcalculateCell layout x y | top == -10 = 1 | top == -1 = 0 | current == -1 = -1 | left == -1 && right == -1 = topleft + topright + top | left == -1 = topleft + top | right == -1 = topright + top | otherwise = top where current = fromMaybe 0 (safeGet x y layout) top = fromMaybe 0 (safeGet (x - 1) y layout) left = fromMaybe 0 (safeGet x (y - 1) layout) topleft = fromMaybe 0 (safeGet (x - 1) (y - 1) layout) topright = fromMaybe 0 (safeGet (x - 1) (y + 1) layout) right = fromMaybe 0 (safeGet x (y + 1) layout)calculateRow :: Matrix Int -> Int -> Matrix IntcalculateRow m row = mapPos (\(a, b) x -> if a == row then calculateCell m a b else x) mtraverseV3 :: Matrix Int -> Int -> Matrix InttraverseV3 input row = output where newMatrix = calculateRow input row output = if row == nrows input then newMatrix else traverseV3 newMatrix (row + 1)numerizeVector :: V.Vector (V.Vector Char) -> V.Vector (V.Vector Int)numerizeVector = V.map (V.map numerizeInput)main :: IO ()main = do -- contents <- readFile "test.txt" contents <- readFile "input.txt" -- contents <- readFile "bigboy.txt" let part2_traverse = traverseV3 (inputMatrix contents) 2 print $ V.sum $ getRow (nrows part2_traverse) part2_traverse>>107517688I get the overall sense of what the code is doing but I couldn't follow the function line by line. Thanks for the pdf though.
import Data.Matriximport Data.Maybe (fromMaybe)import Data.Vector qualified as VnumerizeInput :: Char -> IntnumerizeInput c | c == 'S' = -10 | c == '.' = 0 | c == '^' = -1inputMatrix :: String -> Matrix IntinputMatrix = fromLists . map (map numerizeInput) . linescalculateCell :: Matrix Int -> Int -> Int -> IntcalculateCell layout x y | top == -10 = 1 | top == -1 = 0 | current == -1 = -1 | left == -1 && right == -1 = topleft + topright + top | left == -1 = topleft + top | right == -1 = topright + top | otherwise = top where current = fromMaybe 0 (safeGet x y layout) top = fromMaybe 0 (safeGet (x - 1) y layout) left = fromMaybe 0 (safeGet x (y - 1) layout) topleft = fromMaybe 0 (safeGet (x - 1) (y - 1) layout) topright = fromMaybe 0 (safeGet (x - 1) (y + 1) layout) right = fromMaybe 0 (safeGet x (y + 1) layout)calculateRow :: Matrix Int -> Int -> Matrix IntcalculateRow m row = mapPos (\(a, b) x -> if a == row then calculateCell m a b else x) mtraverseV3 :: Matrix Int -> Int -> Matrix InttraverseV3 input row = output where newMatrix = calculateRow input row output = if row == nrows input then newMatrix else traverseV3 newMatrix (row + 1)numerizeVector :: V.Vector (V.Vector Char) -> V.Vector (V.Vector Int)numerizeVector = V.map (V.map numerizeInput)main :: IO ()main = do -- contents <- readFile "test.txt" contents <- readFile "input.txt" -- contents <- readFile "bigboy.txt" let part2_traverse = traverseV3 (inputMatrix contents) 2 print $ V.sum $ getRow (nrows part2_traverse) part2_traverse
>>107517705>>107517805Hey, I am not a CS major, and I started writing stuff in Haskell with this year's AOC. I am doing pretty good if I say so myself. My solutions took a lot of time to write though
>>107517865respect
>>107517680i solved it iteratively with tabular dp, no memoization as far as the eye can see.
Yesterday doesn't count. I remain unfiltered.
>>107517865>>107517607I struggled so much with mixing up the result at the current and previous/next nodes and where to actually put the backwards-sum so far
>>107516124you're not the only one :(
>>107516440Weird ice block but okay
>>107514271we meet again, challenger (>>107514305(Me))1.7msI thought kahn's would be too boring so instead I implemented the usual recursive DP solution using an explicit stack, so no recursion. also, I don't want to map nodes to integer IDs so there is some lost opportunity there. main issue rn is that I am traversing the entire graph for each count paths.
the fall of aoc must be studied, from the peak of breakout in intcode to some boring topo sort
>>107518434>topo sortit's not even that, a memoized dfs with the graph being a hashmap with string labels for the nodes solves today in 300μs.
>>107516440This is a cool puzzle. Not hard but fun and unique. Nice work!
>>107518434>>107518455https://adventofcode.com/2024/day/5mfw 2024 day 5 > day 11 (~23 when scaled up)
Just realized I logged into my github account this year when previously I used my google account... my account is borked now
>>107518426What time did you get mein meger
>>107518538Try asking Eric. He might be able to merge the accounts manually.
>>107518538https://adventofcode.com/settings
>>107518788>the destination account needs to be empty
>>107518815just email admin(at)adventofcode.com with your owner proof
Criminally underrated solution to day 10. This guy wrote half a linear optimizer and barely anyone noticed. >>107514689
if you're a sql fag this is kinda fun. i've only done a few of them and they only take like two minutes each, but stilldbpro.app/advent-of-sql
>>107518946how much do you get paid?
>>107518946looks cool thanks
>>107518876he wrote it in an ugly gay language so why would I care? he'd get an updoot if it was C.
>>107518840I will now email eric your code and tell him to remove all of your um I mean all of "my" stars ;^)
>>107519019i'm unemployed, thank you very much. there's no login or anything and there's a little editor on the page so it's not like your downloading their shit
>>107518743Eric cant even make all the puzzles this year.
>>107516059giving out solutions up-front disallows puzles like finding the christmas tree last year
i was doing 2019 and man it was kino
given the underground base theme surely we'll find a secret tunnel trafficking&sacrifice conspiracy cabal that needs to be stopped for the next 13 days, r-right?
4chan btfo by based redditor finding the straightforward linear algebra and solver-free intended solution to day 10https://www.reddit.com/r/adventofcode/comments/1pk87hl/2025_day_10_part_2_bifurcate_your_way_to_victory/
>>107519593damn, i was thinking about that, but didn't land on halving the result to get the new resultbtfo by reddit, grim
>>107519593I hate to admit it but: I kneel. That is very clever. Will try to implement after work tonight.
>>107519413we find a drunk santa in the control room and he wants to play russian roulette with you and 500 elves. instead of trading one revolver back and forth, he gathers 502 pisols, loads one bullet into each, and then spins each cylinder. you quickly jot down how many clicks you hear for each revolver (your puzzle input). after 11 years of aoc, you yearn for death's sweet embrace. how many of the revolver options will kill you on the first trigger pull?
>>107519593>solved it using z3 first
>>107519674>santa somehow spins the non-existent cylinder on a pistoleric's not even fucking trying
>>107518320>Yesterday doesn't count.It does. But fuck the simplex algorithm. Aargh!
>>107519593Big deal. They outnumber us 50 to 1, of course they'll come up with a couple of good ideas.
most memorable AoC characters? for me, it's volcano elephants
>>107519413>You get to the bottom of the lair to find santa upside down in a crevice. The elves have been trying for 12 days to no avail to pull him out, and have determined that the smell of the rotting flesh from his immense body will be too much to bear. Calculate the amount of Nutty Putty brand concrete needed to fill in the underground lair completely
>>107519796Elephants and geode cracking robot production
>>107516602I can host static puzzles fine; don't have a system for dynamically generated inputs, ofc, but hosting static text is obviously easy.Also a reminder to everyone else that I'm trying to organize enough anons to make some summer puzzles! Come on, it'll be fun!https://obonofcode.com
>>107519413Nope, we are heading down into Santa's sex dungeon where the rest of the days before Christmas will be spent on the rack with Mr. Fisto
>>107519593Eric doesn't know anything about linear algebra (I'm not counting highschool tier stuff), so it makes sense that he wouldn't intend anything deeply mathematical.
the numbers eric what do they meanI have no idea if I am on the right trackI saw a complain about linear algebra so I started trying random stuff and then adding up or counting things to see if it matches the test outputbut I cant get anything to match particularly wellthis problem is making me full schizo
Unofficial filter update
Currently making a site for a puzzle. Thank god for AI slop, because I really wouldn't know enough about web shit to finish this by tomorrow otherwise.
>>107519413I'm thinking>we didn't finish the tasks in the current sprint, it's crunch time till christmas
>>107519873Eric has a PhD from Carnegie
>>107520128and?
>>107519593how do you know the minimum presses for 2, 4, 4, 6 is double the presses for 1, 2, 2, 3?I mean it is obvious you can double the presses but not obvious that it is still the minimum.
>>107519939>chart goes out to day 25bros... it hurts
>>107519832>weeb code problemsbased. isn't the year 2026 tho?
>>107520156is it really the minimum? i think there can be cases where it doesn't hold
>>107517607Here is a golfed version of the paths function, I think it is easier to follow. I think it showcases well a common trick to do memoization in Haskell : Rather than calling the function directly, you fill a data structure (here the Map memo) with your memoized subproblems (paths from any label to the "to" label). Since Haskell is lazy, the values of your table are not computed until you need them (the recursion step in memPaths), but then they are computed at most once.Basically what >>107517688 said (the =0 case is not nonsense though, its because you might reach "out" in your recursion, and out is not a key of the table).
>>107520211the redditor solved it so apparently it is
I think I'll have my PS2 solution for day 9 done by the time day 13's problem releases.
>>107520156>>107520211Counterexample: buttons = (0,1), (1,2), (0,2), (0)Minimum presses for target {2, 2, 2}: 3Minimum presses for target {1, 1, 1}: 2
>>107520301i believe in you, ps2anonyou'll have it earlier than never
>>107520303ok so reddit isn't so smart after all
>>107519939Hey!
>>107520301And if I steal >>107519593 I can probably do day 10, but we'll see.
>>107519832>don't have a system for dynamically generated inputsWell, not yet, at least. Just put the site up today.
>>107520386>implying you didn't just get it
>>107520303i was thinking about something like this too, it's similar to the knapsack problem
>>107520388The solution has been debunked. See >>107520303
Claude is 22/22 one shot. I am demoralized. I understand doing it for hobby and fun and interest and learning, but in reality and practice how much will that matter in the future? These smaller kinds of test-like problems are essentially just beat. Thinking and solving are becoming more and more useless by the week.
>>107519593Did you read all the solutions here? I am quite sure someone solved it like that. I contemplated using that approach but i have brain damage so z3 it was.
>>107520416I got it like 30 minutes ago.
>>107520463>working on Christmas-related coding project>I'll just ask Claude to set up the core functionality; no point in wasting time on boiler plate>it 3-shots nearly the entire project>haha it got lucky. Time to comb through this code and clean up the slop>it's nearly perfectIt still leaves too many comments though
>>107520303It worksWhen targeting 2,2,2 you try every combination of button presses so you'd try both no presses+2*(best of 1,1,1) and 3 presses+2*(best of 0,0,0)
>>107520463It doesn't matter at all anymore. This is literally on par with playing a video game for fun now.A lot of us are wrestling with the fact that a skill we used to really like being valued for and that gave us abilities other people didn't have is now basically worthless, so you're certainly not alone. But we all have to come to terms with it, one way or another.That being said, I still do the problems without AI just because it's something that makes me smile and I like spending the holidays with you guys.
so now that aoc is almost over what are we thinking about the 12 day format?
>>107520503Claude, Gemini and (increasingly) Qwen are better than 80% or so of programmers at this point. Coding is probably already on par with writing machine code: an incredibly niche skill that people mostly know for fun or because their particular expertise in it can be bought for slightly less than throwing compute power at the problem in one or two cases.Vaudevillians saw movie theaters and cried too.
>>107520645Pure shit. Went straight from fun early days to melancholic last days. I do this shit to distract myself from my skillset being valued at six figures to being valued less than a 60 cent API call and this isn't exactly helping.
>>107520128Prove it.>Eric: I’m originally from Minnesota, but I moved to New York to go to the Rochester Institute of Technology.
>>107520463>Think of a way to solve day 10>Ask chatgpt to implement Gaussian elimination.>It does>Ask it to change it to gauss-jordan and account for non-square A>It does>Solution given isnt the smallest (might be bad promting on my part)>Ask gemini 3 pro because its supposed to be the best>Give it presice explanation of the problem, thought prossess, constraints, attempted solution.>Finds a bug>Still not correct but closer so try again>Finds "bug", that I explicitly asked it to ignore>Ask once again>I suddenly count less button presses>Free limit usage reachedAlso, even if the chatbots manage to stumble their way to a solution, it is rarely optimal, or even good for that matter.
>>107520671I was just making shit up. He could be a drop out for all I know
>>107520686Also I forgot, gemini needed to sort button sizes and chose to implement bubble sort "for its simplicity"
>>107520686>Need to make a one-line change in a unit-level test>Tell claude in agent mode to fix it and retest it>claude makes 3 scripts to test the unit level script and writes up 5 readmes>have inifinite work tokens so oh well
>>107520686>>107520695>>107520717This kind of overly wordy jeetcoded crap actually makes Gemini a really good web developer.
>>107519593>minimum presses to reach (2a, 2b, 2c) = 2 * min presses to reach (a, b, c)this is only true if all our buttons (x, y, z) are linearly independentif all our buttons is the matrix A, then there's only one (all positive) x such that Ax = b (for joltage b)so then 2Ax = 2b, or A(2x) = 2b, in the case of linear independence then 2x is the only such all positive solution.But if buttons are not linearly independent and some such Ay = 2b, if y has an odd component (i.e. you press one button an odd number of times), then A(y/2) != 2b (because y/2 isn't an option) and and it's possible sum(y) < sum(2x)We know a good number of button sets aren't linearly independent because they have more buttons than possible joltage positions being incremented
>>107520686>Copy and paste problem >Claude solves itIt's that simple
>>107520645The best puzzles are the meduim-hard ones IMO, which were completely cut out this year.The two hard ones weren't even that great to make up for it.
>>107516371>back home really drunk≥5 hours leftIt's show time, let's gooooo
>>107519939Unbowed, unbent, unfiltered
daily sloppa
did anyone else used "multi path" memoization for today's puzzle?save current node result together with whether dac/fft were visited or not.
>>107520463non-programmers can't use Claude to get real work done, and can't turn a real-world problem into a puzzle that Claude can one-shot. Non-programmers feed spreadsheets to AI instead of asking AI to write a program to process the spreadsheets.Try to teach a random person to program, even once. You will be astonished.
I think you CAN be greedy based on button length. For example If you have 3 6 length buttons, 2 5 length, 2 2 length, you can hit the 6 length buttons any number of times in any order to reduce the problem down into brootable range. They all maximally increase the joltage/button press. And as long as you stop and broot when you have ~30 voltage to go in dont think it would interfere with weird edge cases. Im going to try to code this up now and unfilter myself (I cheated and used z3)
>>107520985I saved node results, but I calculated srv to fft to dac etc separately
>>107521011seems like a more optimal approach, cool
>>107520985>save current node result together with whether dac/fft were visited or not.Whether or not dac/fft were visited was tracked and part of the search state for me, and when it hit the end it returned 0 instead of 1 if they were missingIDK if that's what you mean but it was all in one pass instead of multiple searches
>>107521005Wait I am wrong.consider (0 1 2 3 5) (1 2 4) (0) (1) (2) (3) (4) (5) [100 100 100 100 10000 100]Greedily pressing the first button would be bad. As to get rid of the 4s you would want to press the (1 2 4) button, and greedily pussing the first button would disallow this
>>107515633nice OP, what's the name of the painting?
>>107521038the check is the same yesWhenver i visit a node i check i if i have memoized values and the conditions when they were memoized. i.e. it had visited only fft. If the current path has also visited fft then i can return the memoized value. Basically do the checks for all combinations (fft, dac, fft and dac, nothing)
>>107517310filtered
>>107520688He said himself that he doesn't know much about math, and claimed to have never heard of the Chinese Remainder theorem, which is strange, even for a comsci guy. This isn't to say he's stupid either, he's clearly bright, but he doesn't have a formal education in some advanced mathematics that he's going to pretend is trivial enough to put in his puzzles.
>>107520994But do you have to teach them? All they need to do is copy and paste problems and just ask. Like the future is - you want a web app? To the ai - can you make this webapp? Then it keeps asking you what you want to add now so you don't even need to ask the right questions.Cleetus and Jeetamaraj can output the same with AI
I didn't even bother looking at today, I have giga fatigue. How bad is it?
>>107517310>Dane Chad >Math PhD>HPC specialist How do you respond without seeming mad?
>>107521178Fairly straightforward, no harder than the first week
>>107520952thanks for the slop, enjoy reading these
>>107521178literally baby's first memoization puzzle, not hard at all
>>107521218np. alternate. i guess there wasn't that much to go off of today
[#.#...#.] (0,5) (1,2,3,6) (3,6) (0,2,3,5,6,7) (1,2,3,5,7) (1,2,3,4,6,7) (0,1,3,4,5,6,7) {24,26,25,33,13,24,33,19}can anyone with a working day 10 p2 solution solve this for me? (with counts of each button)
[#.#...#.] (0,5) (1,2,3,6) (3,6) (0,2,3,5,6,7) (1,2,3,5,7) (1,2,3,4,6,7) (0,1,3,4,5,6,7) {24,26,25,33,13,24,33,19}
>>107521322x0: 11x1: 13x2: 1x3: 6x4: 0x5: 6x6: 7
>>107521253>HOLD THE LINEi thought this was about not taking a piss until after you finished the puzz
gpt beat my runtime with topological sort, AGI confirmed, it's fucking over for meatbags
>>107520779Proof by contradiction that the solution is correct: Assume that there is a way to get (2a,2b,2c) faster than 2x(a,b,c). Then by definition it presses some buttons an odd number of times. Remove those button presses and you get an optimal solution of 2x(x,y,z). Xor those buttons with your original bit pattern, folding the duplicates into the residual, you get an optimal solution for 2x(p,q,r) which the algorithm will consider with the modified pattern. So no optimal solution will remain untried, the output will be correct.TLDR it doesn't matter that the strategy used at one step of the algorithm isn't optimal, some other step will surely be optimal
>>107521456(0,1) (1,2) (0,2) (0) (1) (2) {1 1 1} #2 presses(0,1) (1,2) (0,2) (0) (1) (2) {2 2 2} #3 presses
>>107521367Seconding this answer
>>107521456What if there's a button that does. (42, 12, 22) and you found the fastest way to get to (21, 6, 11) was to press (3, 0, 0) 7 times, (0, 6, 0) 1 time and (0, 0, 11) 1 time?
>>107521253This is so soulful, thank you, anon. You and draw anon are why we come here.
>>107519074Retard
>>107518876sorry anon, everyone is too busy "not being filtered" by using z3 and ai. /aocg/ is over.
>>107521501thats..... not how the buttons work
I implemented thisIt works16 seconds on my inputFind a counterexample if you canfrom functools import cachefrom itertools import chain, combinationsimport math@cachedef f(buttons, target): if all(t == 0 for t in target): return 0 if any(t < 0 for t in target): return math.inf best = math.inf for c in chain.from_iterable( combinations(buttons, i) for i in range(len(buttons) + 1) ): decrement = [0] * len(target) for b in chain.from_iterable(c): decrement[b] += 1 new_target = [t - d for t, d in zip(target, decrement)] if any(t & 1 for t in new_target): continue best = min(best, 2 * f(buttons, tuple(t // 2 for t in new_target)) + len(c)) return bestr = 0for l in open("input.txt"): l = l.split() levels = tuple(map(int, l[-1][1:-1].split(","))) buttons = tuple(tuple(map(int, b[1:-1].split(","))) for b in l[1:-1]) r += f(buttons, levels)print(r)
from functools import cachefrom itertools import chain, combinationsimport math@cachedef f(buttons, target): if all(t == 0 for t in target): return 0 if any(t < 0 for t in target): return math.inf best = math.inf for c in chain.from_iterable( combinations(buttons, i) for i in range(len(buttons) + 1) ): decrement = [0] * len(target) for b in chain.from_iterable(c): decrement[b] += 1 new_target = [t - d for t, d in zip(target, decrement)] if any(t & 1 for t in new_target): continue best = min(best, 2 * f(buttons, tuple(t // 2 for t in new_target)) + len(c)) return bestr = 0for l in open("input.txt"): l = l.split() levels = tuple(map(int, l[-1][1:-1].split(","))) buttons = tuple(tuple(map(int, b[1:-1].split(","))) for b in l[1:-1]) r += f(buttons, levels)print(r)
>>107520156>>107520211>>107520303{2, 4, 4, 6} isn't guaranteed to have its minimum number of presses required be equal to 2 * {1, 2, 2, 3} because there may be some combination of buttons that sums up to {2, 4, 4, 6} directly within less presses, but you would also find that when implementing their solution by iterating through all button combinationsin the {2, 2, 2} example, buttons (0,1), (1,2), and (0,2) sum up to the joltage requirement directly, so 3 would be considered its medium if a joltage does not have a combination of buttons that sum up to it directly, then the only way to reach that joltage is to press at least one button multiple times, which is what you're solving for when recursing and multiplying by 2
>>107521748>would be considered its mediumwould be considered its minimum*
>>107521657At least with z3 you have to know how to formulate your problem, there's even books out there on how to translate problems into something a linear optimizer can solve, it's not as trivial as it seems. AI is like handing the entire problem off to someone else, and never learning anything.
>3 hours to goI assume all anons have created an import solution macro
>>107521456>Assume that there is a way to get (2a,2b,2c) faster than 2x(a,b,c). Then by definition it presses some buttons an odd number of timesHow do you know this at runtime without brooting it? at which point all of this is pointless?> Xor those buttons with your original bit pattern, folding the duplicates into the residual, you get an optimal solution for 2x(p,q,r) which the algorithm will consider with the modified pattern. So no optimal solution will remain untriedSo the heuristic reduces down to an some (2a, 2b, 2c) and then broots all possible solutions to find the optimal path? what's the point then?The OP didn't even mention that, the OP described>let factor = 1>reduce to some (2a,2b,2c) -> keep track of (steps * factor), add this to sum>divide until you reach (x, y, z) -> multiply factor by 2 for every division>repeat until you reach an end conditionIt's clever, and it's a effective technique (e.g. : https://en.wikipedia.org/wiki/Exponentiation_by_squaring)
>graph bfs library sees no dac->fft pathsI always get punished for avoiding the straightforward recursive DFSit's karma. God loves DFS.
Late RISC-V.
>>107521748same (2, 2, 2) example but with (6, 6, 6)you divide by 2 to get (3, 3, 3)., you can reduce this to (2, 2, 2) with 2 presses. Then you can solve (2, 2, 2) with 3 as a combination of singles. So you have 2 + 3 = 5 presses to achieve (3, 3, 3), multiplied by 2 this is 10 presses to achieve (6, 6, 6)however (6, 6, 6) is reachable in 6 presses.Point is OP never mentioned checking for 0 or 1 combinationsEven if he did mention that, which he didn't, he didn't mention checking it's factorization by non even factors
cannot be arsed to read a reddit post has someone proven him false yet?
>>107522087I've formulated a proof but it's too long to fit in a post and you guys probably don't know enough inter-universal teichmuller theory to understand it anyway
>>107522087The post is tl;dr, maybe he didn't explain it completely or correctly, but the method works
>>107522099You just know Fermat was capping about having a proof. He could have found more paper.
>>107519593>>107520156>>107520536>>107521748Counter example: buttons = (0,1), (1,2), (0,2), (2)minimum presses for target {2, 4, 4}: 5 - (3, 1, 1, 0)minimum presses for target {1, 2, 2}: 3 - (1, 1, 0, 1)There's no way you're finding (3, 1, 1, 0) without practically brooting it
>>107522069You try all combinations of buttons before halvingSo you'd try 2*f(2,2,2)+3 (since 4,4,4 is reachable from 6,6,6 with at most one press of each button) and 2*f(3,3,3) and take the better one
>>107522120It is broot when the targets are so lowThe halving is what makes it practical when the targets are 50+
>>107522120> 5 - (3, 1, 1, 0)That makes {4,4,2}
>>107522168Same principle holds at higher numbers, point is dividing + testing singular combinations isn't foolproof>>107522242Fuck, (1, 3, 1, 0)
>>107522069>(6, 6, 6) is reachable in 6 presseswith (0,1), (1,2), (0,2), (0)?no it isn'tit's doable in 9 minimum, which is found by subtracting the combination of the first three buttons to get {2, 2, 2} and again subtracting the first three buttons to get {0, 0, 0}3 + (3 * 2) = 9>Point is OP never mentioned checking for 0 or 1 combinationsyou're supposed to>Even if he did mention that, which he didn't, he didn't mention checking it's factorization by non even factorsyou don't have to recurse if the resulting joltage after checking a combination has any odd numbers in it
Eric is getting furious that some of you are calling him a mathlet, expect a Fields medal tier difficulty problem tonight. Pro tip: you're not going to make it, you're not going to collect your stars, you're not even going to have a Merry Christmas.
>>107522168I only read a quarter of that post to not spoil myself but why stop at halving? take gcd of joltages and if it's not 1 then divide all by it and the result of subproblem times gcd
>>107520952how much of this is generated vs something like in-fill? if its one-shot generated i am very impressed
>>107522120>{2, 4, 4}use first three buttons to get {0, 2, 2} in three pressesrecurse with {0, 1, 1}solve by pressing second button3 + (1 * 2) = 5
Day 10 filtered me. 11 was good. Looking forward to 12.
>>107521933>not understanding why bfs will not workanon, sorry to say but that's a filter
>>107522323PftPart 1: What is 2+2?Part 2: Click if you have 23 stars.EVENT OVER.
>>107522323Problems were completed and generated months ago.
>>107522334consider this line[....] (0,1) (0,2) (1,2) {4,8,8}if you divide everything by 2, you get {2,4,4}which is achievable by pressing the first button once, the second button once, and the third button thriceif you divide everything by 4, the gcd, you get{1,2,2}which has no solutions
[....] (0,1) (0,2) (1,2) {4,8,8}
FUUUUUUUUUUUUUUCK
>>107522412Have you tried subtracting 1?
>>107522334would have to test all combinations up of up to gcd-1 presses of each button
>>107522418If you're that close it doesn't tell you if it's too high or too low, it has to be off by quite a bit.
>day 11>oh hey look a simple path search cache problem>prevent infinite loops>try it out>wrong answerwat
>>107522120works on my machine
>>107522395that makes sense. what about (0,1) (0,2) (1,2) {6,6,6}? will dividing by 2 be the best option?>>107522474are you using the cached result of all children? that was my bug. I was only adding result of children not already visited
>>107522488im not even caching until I get the result from all children so thats not it
>>107522494just send code if you you are a filter fearing anon. you have still got time tho
>>107522501im not THAT scared its probably a stupid small bug
>>107522505are you finding all shortest paths instead of all pathsthat fucked me up for a long time because it worked on part 1
while I am not sure the extent it simplifies things yet at least the first preprocessing part of the new strategy looks like it workswtf was eric thinking putting this on a weekday
>>107519593>>107519760and I didn't see them using prim's for part 2 of the dsu day in O(n^2). anons thought of it
THE GREAT FILTER
>>107522524having last 3 days be during work week is fucking retarded
>>107522519im finding all paths and im on part 1, my answer is too high actually
>>107522530>t. the filtered
>>107522539just show code retard
>>107522530it is particularly offensive when last weekend was a huge nothingbirg
>>107522488>what about (0,1) (0,2) (1,2) {6,6,6}? will dividing by 2 be the best option?not immediately because {3,3,3} has no solutions, but the way the algorithm works, {6,6,6} tries possibilities other than halving and recursing immediately, which does lead to the correct answer
>>107522551fn count_paths(key: &str, connection_map: &HashMap<String,Vec<String>>, count_cache: &mut HashMap<String,i64>,path_cache: &mut HashSet<String>,count: i64) -> i64{ if path_cache.contains(key) { return 0; } match count_cache.get(key) { Some(value) => { *value }, None => { let children = connection_map.get(key).unwrap(); let mut sum: i64 = 0; path_cache.insert(key.to_string()); for child in children { sum += count_paths(child,connection_map,count_cache,path_cache, count+1); } path_cache.remove(key); count_cache.insert(key.to_string(),sum); sum } }}"out" being preseeded in the path cache as 1
fn count_paths(key: &str, connection_map: &HashMap<String,Vec<String>>, count_cache: &mut HashMap<String,i64>,path_cache: &mut HashSet<String>,count: i64) -> i64{ if path_cache.contains(key) { return 0; } match count_cache.get(key) { Some(value) => { *value }, None => { let children = connection_map.get(key).unwrap(); let mut sum: i64 = 0; path_cache.insert(key.to_string()); for child in children { sum += count_paths(child,connection_map,count_cache,path_cache, count+1); } path_cache.remove(key); count_cache.insert(key.to_string(),sum); sum } }}
>>107522563count cache*
>>107522563>rustnvm stay filtered
>>107522571im betting its some stupid rust quirk, still learning the language
>>107522539anon prove this anon >>107522551 wrong. don't post code and diy>>107522562what about trying to divide by all factors of the gcd one by one starting from the largest? here you would try 3 then 2. we get ans when dividing by 3 as 3. so final ans 3*3 = 9
>>107515633so can i get sued for putting puzzle text & input on my github?
>>107522580im closing the thread until i figure it out
>>107522586straight to eric's sex dungeon
>>107522563what are you using count for?where are you returning for out as 1?
the story feels kind of off though like we just hung out at the north pole base?and we will magically solve the problem tomorrow and everything works without barely having met any elephants or what not?
>>107522580You miss solutions doing that because if you divide by 3 you miss better solutions that involve pressing a button twice
>randomly one day learn the term memoization >all of the sudden everyone uses it regularlywe live in a simulation. I may be the only real person.
>>107522623https://en.wikipedia.org/wiki/Frequency_illusion
>>107522623Oh no, I assure you, everything is normal.https://en.wikipedia.org/wiki/Frequency_illusionEveryone experiences it, see?We're all just like you Anon! So stop worrying!Stop worrying, Anon.Stop immediately.
I still don't know what a monad is
>>107522608watch day 12 be an epic puzzle journey that lasts until the 25th
>>107522623no one is real. it's erics simulationhttps://files.catbox.moe/3z365u.mp4
>>107522636A single-celled microorganism, especially a flagellate protozoan formerly classified in the taxonomic group Monadina.
>>107522608eric has given up
>>107522636>I still don't know what a monad isits when of you nads are shot off like in war and you become a uniballer
>>107522586Probably would ask you to take it down if he got wind of it. Worst case he'll send a takedown request to github (I think he did that once when someone sperged at him on reddit), but probably won't bother unless you're an asshole.Suing isn't worth the lawyer fees.
>>107522636A dyslexic nomad
>>107522657thats so stupid....if im going to spend time & effort on a challenge to write a code then i'd want to put some context around that code so people can see it and understand what i've doneso i feel like i get something in return for participating, just like he gets something from me participating.
1 HOUR
>>107522623Son, this is the ELEVENTH year we've been doing this competition. It's rinse and repeat.
>>107522615can you share an example of this? I get why sticking to 2 is great though. you only have to deal with parities and not divisibility>>107522677off by 1
>>107517652"PoohPooh to the Anons!" he was grinchishly humming."They're finding out now that no Day 13 is coming!""They're just waking up! I know just what they'll do!""Their mouths will hang open a minute or two,Then the Anons down in 4Chan will all cry BooHoo!""That's a noise," grinned Eric, "That I simply MUST hear!"So he paused. And Eric put his hand to his ear.And he did hear a sound rising over the snow.It started in low. Then it started to grow.But the sound wasn't sad! Why, this music sounded cancer!It couldn't be so! But it WAS cancer! VERY!He stared down at Whoville! The Grinch popped his eyes!Then he shook! What he saw was a shocking surprise!Every Anon down in 4Chan, the tall and the small,Was singing! Without any presents at all!He HADN'T stopped Day 13 from coming! IT CAME!Somehow or other, it came just the same!And Eric, with his Eric-feet ice-cold in the snow,Stood puzzling and puzzling: "How could it be so?""It came with out leaderboards! It came without inputs!""It came without test-cases, story or OAuth2!"And he puzzled three hours, till his puzzler was sore.Then Eric thought of something he hadn't before!"Maybe /aocg/," he thought, "doesn't come from a store.""Maybe /aocg/...perhaps...means a little bit more!"And what happened then? Well...in 4Chan they say,That Eric's small brain Grew three sizes that day!And the minute his brain didn't feel quite so tight,He whizzed with his load through the bright morning light,And he brought back day 13! And the inputs for the puzzles!And he, HE HIMSELF! Eric posted Nightcore - Rockefeller Street!
>>107522640if eric had steel in his balls he'd give a puzzle hard enough that it can't even be solved in less than 12 days
I love you guys.
>>107522731eric should make a year where everyone has the same input and everyone gets the star when a single person submits the correct answer,but the problems are so brutally difficult that it takes the coordination of the whole advent of code community to find the answer
>>107522636I’m afraid you’re Monarded
>>107522743I love you too
considering its a real possibility there wont be a 2026 /aocg/, should we start putting thought into other yearly challenges? any suggestions?
>>107522672Realistically, you'll be fine as long as you don't go posting it on reddit, or you're not a "high profile" person.
>>107522802I WILL be here december 1st 2026. We will make our own puzzles if we have to.
>>107522802I'm working on one!https://obonofcode.comRight now I'm just collecting email addresses and Discords from people who would be interested in helping make puzzles, but we're shooting for summer.
>>107522362I just always want it to work, regardless. It's like a man with a really cool hammer and a shitty rusted screwdriver. Even if you give him a screw, why not see how the hammer does? The hammer is so cool.The highlight was changing a List.append to a cons, and turning a quick 40GB of memory into something that was only going to take a lot of CPU.
>>107522802everybody codes
>>107521933there probably is no paths in that direction then? its entirely possible you can only go svr -> fft -> dac -> out
>>107522802>possibility there wont be a 2026 /aocg/If /g/, AoC, and myself still exist after year, there will be a 2026 /aocg/.
>>107522802everybody codes is an aoc-like during november, we had a couple threads on here for it
there once was a man named eric,he used to come up with puzzles galore.this year however, he has given up on being clever,and the days have kinda been a bore.
>>107522623in my timeline we use memoisation all the time
20 minutes...until advent of code is over
>>107522820you can make bfs work but only if you process the nodes in topological order. that means only process a node if all its children have been processed, or vice versa if you are counting paths from start instead of counting paths to the end, you can only process a node if all its parents have been processed
mazeless advent of code? It's more likely than you think.
>>107522902last day is dijkstra's... for tradition
eric is going to do a surprise reveal of 13 more questions, i know in my heart he will
How disappointed will you be when day 12 really is the last day of the year and your cope about thirteen more puzzles magically opening up is wrong?
>>107522707From my input, (1,2,3,4) (0,1,2,4) (0,4,5) (1,2,4) (1,2,3,5) {17,25,25,5,33,14}It tries (0, 4, 5), (1, 2, 3, 5) then has target {16, 24, 24, 4, 32, 12} with gcd 4 but {4, 6, 6, 1, 8, 3} is unreachable whereas {8, 12, 12, 2, 16, 6} is reachable in 17 steps
Getting into the Christmas spirithttps://www.youtube.com/watch?v=sCabI3MdV9g
>>107522919If he does, I'll donate to his "Sushi addiction" if that's still his thing.
>>107521933Check your input.
TONIGHT'S THE NIGHT
>>107522925>transalways pushing the agenda
>>107522922I meant about missing better solutions. if a solution is not found then it should try for other smaller factors. gcd = 4 means factors 4, 2 and then whatever the base case handling was. this sounds nonsensical for gcd = power of 2 but it might be better in other cases? like >>107522488 where division by 3 would be nice and result in a solution for the smaller subproblem {2,2,2} be found
ONETWOSEVENTHREE
>>107522934That band has been around long before the mentally ill co-opted that word
10 MINUTES
unless i get giga filtered tonight, this will be the first aoc i've actually finished. feels a little hollow since i do usually get to at least day 15, so it still feels like i'm quitting earlier than usual
*yawn* quick 5 minute problem then back to bed
>>107522925Goddamn I forgot how awesome this sounds
Let's close out the challenge with some Pavarotti. Ava Maria - https://www.youtube.com/watch?v=XpYGgtrMTYs
>>107522933NO NO NO
>>107522990>ave mariai will always listen
what was even the story this year? i skipped the lore dump on day one
>>107522990*Ave -- I'm gonna shoot myself.
https://www.youtube.com/watch?v=hjGZLnja1o8This is where I post MERRY CHRISTMAS. Except its not Christmas. Thnaks Eric
>>107523000cancer music
>>107522672>so i feel like i get something in return for participating, just like he gets something from me participating.You get to participate retard, he doesn't even make money from this, fuck does he get?If you're that concerned make a sample input, advent of code is so widespread anyone who'd care about your solution knows what it is
>>107522995
5 MINUTES
>>107523000>>107523001>>107523004Merry Christmas, all!
>>107522995at the north pole. straight up "jolting it". and by "it", haha, well. let's justr say. My peanits
>>107523018haha
>>107523018LOL!
I know I've shilled it before, but if you guys would please at least sign up for updates on the Obon of code site. I want to stay in touch with you all after these threads disappear.
>>107522951Works on my input using greatest common prime factor (although it's slower than only 2)Interesting
>>107523023not joining your trooncordnot giving you my emailcome up with a better method
>>107522995why, my peenus weanus of course :)hahah! :Dit's my weeeeeenus peanus! :) hahahITT: what the story is even about this year - my answer is, of course, my peanus weenus :Dhahaha!
>>107523023I submitted my email, despite my distates for weebery and d*scord
>>107523006>he doesn't even make money from thishe literally does. Through AoC+. Which people buy because its a famous puzzle site. Which it is because people like me play it. Now i wont anymore.
>>107523026I'll send a smoke signal, tinfoilhatanon
>>107523000Merry Christmas! I hope the thread will stay alive and figure something else out to do. If Eric isn't seething with regret and fails to revert to 25 days next year I expect an alternative to take its place entirely.
>>107523035reminder to look out for everybody codes in november next year
FUCK
the great filter
>advent of parsing
what the fuck you guys said today would be easy
this is some niggerlicious input
oh god
oh this looks hard actually. But I just want to say>There are a few Elves here frantically decorating before the deadline.WHAT DEADLINE ERIC YOU HACK FRAUD
is this brootable or would I just be wasting my time.
>raped by the parser award
>>107523074I see a grid, I'm gonna BFS it
how the fuck do you even do thiswhat do I skim to learn how to even start doing this
>grids are all in the realm of 50x50 with hundreds of presentsbrootbros I'm worried
>>107523084skim Tetris
I am NOT parsing that shit
erm i might actually be filtered. wtf i thought last day was supposed to be a victory lap
this looks fun so I am going to log off from aocg. cya on the other side anons
>cool i managed to wake up before the puzzle so I can do it before work>it's fucking tetris again
>>107523098proof it's not the last day?
>>107523094>Tetris Puzzle Solver>It fills a rectangle of given size with a set of tetrominos (tetris pieces) using an optimized brute force algorithmuh oh
uhhharen't these kind of big search spaces?putting 300 shapes into a 50x40 grid (=2000 spaces)? AND they can be rotated? WHAT THE FUCK
>>107523111I can think of a few ways to prune the search space but damn
bros I can't do this...... Z3 can't solve it for me......
grok what is 50 * 40 * 300 * 8 ? (not sure how many rotate+flips there are)
i bet it's gonna have a real part 2 as well, fucking eric
y'all faggots said this would be import solution. jesus fucking christ
I kind of want to hardcode all the flips and rotations because im stupid
eric what the fuck
>>107523126grok says broot is hopeless
i aint doing this shit
>>107523147If its like the previous years' final problem it'll just be a freebie second star
>>107523158you don't say. i need to solve the non free first part for it
I think the solution here is in the fact that there's only 5 giftsYou could probably calculate all possible combinations/rotations of them to create a set of "super-gifts" then operate on those instead
>>107523162mean to reply to >>107523146 sorry
Day -Part 1- -Part 2- 12 00:17:17 00:17:31the sweet sweet release
Day -Part 1- -Part 2- 12 00:17:17 00:17:31
>>107523156I don't think I trust grok anymore, it might not know what it's talking about and got in a doomer loop
>do something retarded>it just works for the input, but not the example
>>107523189I kneel
>>107515633bow to mehttps://litter.catbox.moe/bg3c49nla66dpxla.png(MODS let my ip range post pictures again damn it)
>someone stuck on silverwhat causes this
>people have already finished>I've only just finished creating all permutations of the shapesit's over
>>107523207>.pnglol not clicking on the malware bro
>>107523211cheated and is trying to make it look like he didn't copy a solution, not like >>107523189who made it really obvious
>>107523221do you think by stuck on silver i meant the silver problem or silver star. the second half is free, so it's very obvious you're trying to pad for time if you get the first part and then just don't click on the button for the last start>made it obviousdon't hurt my feefees
>>107523211you need to finish all the previous puzzles first before it gives you the freebie.>>107523219well tell the mods to unrangeban my IP from posting .png malwares here then
>>107523248not free if you didn't do a previous problem
Arrrrgrhhhhh he got me! I tried the wild idea of just... checking and of course that worked. The number of permutations was a bit much.
>>107523255no he had all stars that's why i was confused, obv wouldn't have brought it up otherwise
>>107523261and the code.
>>107523194>it workedBut whyNow to feel like I really deserve Christmas I need to prove to my own satisfaction that you can always tetris these nicely
>My retarded idea actually workedI didn't even bother to handle odd numbers.
>>107523264The leaderboards and the Stats page update themselves whenever and however they feel like
>>107523306You can probably go even more retarded. It's literally, "Is there enough space for the total amount of # needed?"
A bit too early to wish you guys a merry Christmas, I guess. Day 9 and 10 were okay, I guess. today was kinda disappointing. Feels like an attempted cheap shot at AI users. Implementing an actual solution for sensible input might actually have been fun...See you guys next year, if there even is one...
A nice clean ending.I wonder if we'll get another year, or if this was the last one. In any case, it was nice to see you again, lads.
fucking Eric
>>107523324this guy advent of codes
bastard scared me so bad i thought we were all fucked
>>107523320What kind of bullshit is this.
>>107523211it's the retarded caching/throttling Eric added this year
>>107523320in 12x5: 1 0 1 0 3 2, isn't 49 below 60? That's called out as not allowed though
>>107523359>he looked at the examplelol
here is this year's calendar
>>107523363>Answer works on the real input but not the example.OK.. inverse AoC day? Bravo, Eric.
>>107523320kek is this really the answer? you dont have to worry about the shapes at all?i gave up at the start because it looked too annoying
my brute can't even solve the example lol
>>107523370nice iterator masturbation
HOLY FUCKING TROLLYou don't even have to solve the problem
>>107523374he went soft with these inputs lol, I was already thinking of ways to make the shapes form rectangles
>>107523371first real inspired thing this year, but was it worth 11 days of import solution
Not sure if Eric goes on the nice or naughty list for this one. It was definitely unexpected though.
>>107523359Eric mind fucked you.
>>107523383what's the font and theme
merry christmas!
>>107523306>>107523320This is why I fucking hate aoc and Eric. You're presented with hard but interesting problems that are actually solvable except that every time there is a dumb shortcut by design.The problems aren't actually problems and the solutions aren't actually solutions, this is all red herrings and baits. Nothing of this has any value. I couldn't come up with a bigger FUCK YOU to Computer Science even if I tried.It pretends to honour CS and algorithms but in reality all it does is shit on it.captcha: GAYSV
>>107523398https://git.xolatile.top/?p=xolatile-xarbon.git;a=summaryIt's from a based Serb.
let fits p (x :: y :: r) = x * y > List.fold_left2 (fun acc b c -> acc+b*c) 0 p rnot apl but not bad+ 9 lines of parsing
let fits p (x :: y :: r) = x * y > List.fold_left2 (fun acc b c -> acc+b*c) 0 p r
I'm too tired. I don't get the trick. Maybe it will make sense in the morning.
>>107523386That was my first idea before checking the obvious thing. Maybe I can pack it into a "super shape" and then tile that... then I started thinking about all the holes that could generate etc.
>>107523408eric is a fraudsave us obonanon
inb4 the trick wasn't intentional and eric is scrambling lmao
welp i never would've gotten this if i didn't check the thread. can't decide if it's based or retarded that eric just expects you to take a leap of faith on trying a probably wrong answer for the input that fails the test
Jane Street has an Advent of FPGA, I might check that out.
>>107523408that's why it's called a puzzle homo and not an exam
>>107523412didnt bother doing it, sounds like the trick is:>count total number of #s required - if its more than available space it obviously cant fit>count number of 3x3 blocks available - if its >= number of presents then it obviously can fit>those trivial checks are all thats needed to solve the puzzle
>>107523423kek.
>>107523428It's just solving AoC with HDL.
>>107523428>Jane Street Advent of FPGABuy an ad.
>>107523428>>107523435I saw the ad and I was hoping for a set of problems focused on hardware, but it's just AoC.
>naive upper bound just works>0 edge casesI got the flips and rotations, but I wanted to see how many lines I even needed to do tetris on and how many were trivial, andHOLY FUCK RAPE ERIC TO DEATH FOR REAL ARE YOU FUCKING KIDDING ME ERIC?!?!? THIS WAS SHAPING UP TO BE A GOOD PUZZLE YOU LAZY RETARDED FUCK
it's joever...import sysif len(sys.argv) > 1: infile = "test.txt"else: infile = "input.txt"with open(infile,"r") as f: lines = f.readlines()shapes = {}tests = []lines = "".join(lines).split("\n\n")for s in lines[:-1]: s = s.split("\n") sidx = int(s[0][:-1]) coords = set() s = s[1:] for x in range(len(s)): for y in range(len(s[0])): if s[x][y] == "#": coords.add((x-1,y-1)) shapes[sidx] = coordsfor line in lines[-1].split("\n")[:-1]: line = line.split(": ") c = [int(i) for i in line[0].split("x")] nums = [int(n) for n in line[1].split(" ")] tests.append([c,nums])count = 0for t in tests: dim, n_pres = t area = dim[0] * dim[1] total_spots = 0 for idx,n in enumerate(n_pres): total_spots += (n * len(shapes[idx])) if total_spots <= area: count += 1print(count)
import sysif len(sys.argv) > 1: infile = "test.txt"else: infile = "input.txt"with open(infile,"r") as f: lines = f.readlines()shapes = {}tests = []lines = "".join(lines).split("\n\n")for s in lines[:-1]: s = s.split("\n") sidx = int(s[0][:-1]) coords = set() s = s[1:] for x in range(len(s)): for y in range(len(s[0])): if s[x][y] == "#": coords.add((x-1,y-1)) shapes[sidx] = coordsfor line in lines[-1].split("\n")[:-1]: line = line.split(": ") c = [int(i) for i in line[0].split("x")] nums = [int(n) for n in line[1].split(" ")] tests.append([c,nums])count = 0for t in tests: dim, n_pres = t area = dim[0] * dim[1] total_spots = 0 for idx,n in enumerate(n_pres): total_spots += (n * len(shapes[idx])) if total_spots <= area: count += 1print(count)
>>107523431>>count total number of #s required - if its more than available space it obviously cant fitnot even necessary, you can completely ignore the shapes like >>107523399
>>107523446he was patting his belllay filled up with sushi on all that aoc++ money.
>>107523431And here I was ready to cut up some graph paper and see if I could pack shapes together
this has to be the worst aoc of all time
>>107523462most soulless, 100%. feels like you asked an LLM to make all the problems, and it shat out 11 easy ones and one brutal filter that would've been the same style as half the questions in previous years
>>107523425retard, it's not probably wrong, you can verify it's correct.where there's not enough space, it's no question it's wrongand for the puzzle input you can check if there are more columns and rows than three times the sum of the counts, and it will be true for all of the other casesI didn't look at the thread either, I was trying to optimize after implementing the solution and included this and instantly yielded an answer
>>107523462without a doubt. /g/ can still salvage it though. Ill see you all tomorrow
FUCK YOU ERIC FUCK YOU FUCK YOAUSHDFBOIUBIOASUBFASIUFH
>>107523477not the way i did it, retard :)
Are you fucking shitting meWrote a recursive broot, but before calling it I was going to eliminate everything that blatantly couldn't fit.It eliminated an awful lot so I tried that number for the hell of it. Turns out that was the only step required. Searcher is unused and untested, idfk if it works.data = open("Day 12 input.txt", "r").read().strip().split("\n\n")shapes = []for shape in data[:-1]: arrangements = set() base = [] for y, line in enumerate(shape.split("\n")[1:]): for x, char in enumerate(line): if char == "#": base.append((x,y)) for rot in range(4): new = [] mirrored = [] for i in base: new.append((i[1], 2-i[0])) mirrored.append((2-i[1], 2-i[0])) arrangements.add(frozenset(new)) arrangements.add(frozenset(mirrored)) base = new shapes.append(list(arrangements))counts = []for i in shapes: counts.append(len(i[0]))def translate(shape, x, y): new = set() for i in shape: new.add((shape[0]+x, shape[1]+y)) return newdef search(boxes, grid, size): if sum(boxes) == 0: return True for num, box in enumerate(boxes): if box: for x in range(size[0]-2): for y in range(size[1]-2): for boxtype in shapes[num]: if len(grid & translate(boxtype, x, y)) == 0: if search(grid | translate(boxtype, x, y)): return True return Falsetotal = 0for i in data[-1].split("\n"): size, boxes = i.split(": ") x, y = map(int, size.split("x")) boxes = map(int, boxes.split()) if sum(counts[i]*j for i, j in enumerate(boxes)) > x*y: print "asdf" continue total += 1print totalMaybe I should just try the stupidest shit more often.
data = open("Day 12 input.txt", "r").read().strip().split("\n\n")shapes = []for shape in data[:-1]: arrangements = set() base = [] for y, line in enumerate(shape.split("\n")[1:]): for x, char in enumerate(line): if char == "#": base.append((x,y)) for rot in range(4): new = [] mirrored = [] for i in base: new.append((i[1], 2-i[0])) mirrored.append((2-i[1], 2-i[0])) arrangements.add(frozenset(new)) arrangements.add(frozenset(mirrored)) base = new shapes.append(list(arrangements))counts = []for i in shapes: counts.append(len(i[0]))def translate(shape, x, y): new = set() for i in shape: new.add((shape[0]+x, shape[1]+y)) return newdef search(boxes, grid, size): if sum(boxes) == 0: return True for num, box in enumerate(boxes): if box: for x in range(size[0]-2): for y in range(size[1]-2): for boxtype in shapes[num]: if len(grid & translate(boxtype, x, y)) == 0: if search(grid | translate(boxtype, x, y)): return True return Falsetotal = 0for i in data[-1].split("\n"): size, boxes = i.split(": ") x, y = map(int, size.split("x")) boxes = map(int, boxes.split()) if sum(counts[i]*j for i, j in enumerate(boxes)) > x*y: print "asdf" continue total += 1print total
i wonder if this is even solvable "properly"its a more complex knapsack problem but the search space sounds very large
>>107523483>people actually thought it was a fakeout and we'd get 25 dayslol
>>107523450it's sad that this works
>>107523483no fucks to give
stop crying, retards.
>>107523511More like I wasted an hour on an actual solution to part 1 lol
The input is carefully forged to be easyThe space is either slightly smaller than the total size of shapes or much larger[src\day_12.rs:84:13] space - total_shapes_size = -1[src\day_12.rs:84:13] space - total_shapes_size = -3[src\day_12.rs:84:13] space - total_shapes_size = -1[src\day_12.rs:84:13] space - total_shapes_size = -2[src\day_12.rs:84:13] space - total_shapes_size = -2[src\day_12.rs:84:13] space - total_shapes_size = -3[src\day_12.rs:84:13] space - total_shapes_size = -3[src\day_12.rs:84:13] space - total_shapes_size = 635[src\day_12.rs:84:13] space - total_shapes_size = -2[src\day_12.rs:84:13] space - total_shapes_size = 626[src\day_12.rs:84:13] space - total_shapes_size = 584[src\day_12.rs:84:13] space - total_shapes_size = 512[src\day_12.rs:84:13] space - total_shapes_size = -3[src\day_12.rs:84:13] space - total_shapes_size = -3[src\day_12.rs:84:13] space - total_shapes_size = -1[src\day_12.rs:84:13] space - total_shapes_size = -3[src\day_12.rs:84:13] space - total_shapes_size = 502[src\day_12.rs:84:13] space - total_shapes_size = -1[src\day_12.rs:84:13] space - total_shapes_size = 446
[src\day_12.rs:84:13] space - total_shapes_size = -1[src\day_12.rs:84:13] space - total_shapes_size = -3[src\day_12.rs:84:13] space - total_shapes_size = -1[src\day_12.rs:84:13] space - total_shapes_size = -2[src\day_12.rs:84:13] space - total_shapes_size = -2[src\day_12.rs:84:13] space - total_shapes_size = -3[src\day_12.rs:84:13] space - total_shapes_size = -3[src\day_12.rs:84:13] space - total_shapes_size = 635[src\day_12.rs:84:13] space - total_shapes_size = -2[src\day_12.rs:84:13] space - total_shapes_size = 626[src\day_12.rs:84:13] space - total_shapes_size = 584[src\day_12.rs:84:13] space - total_shapes_size = 512[src\day_12.rs:84:13] space - total_shapes_size = -3[src\day_12.rs:84:13] space - total_shapes_size = -3[src\day_12.rs:84:13] space - total_shapes_size = -1[src\day_12.rs:84:13] space - total_shapes_size = -3[src\day_12.rs:84:13] space - total_shapes_size = 502[src\day_12.rs:84:13] space - total_shapes_size = -1[src\day_12.rs:84:13] space - total_shapes_size = 446
>>107523482let's fucking go
we'll have an aftermath thread, right?
>>107523569Of course, threads always run for at least a full day after the last puzzle releases
I solved it.I'm going to strangle Eric.
>>107522607Debugging"out" is already in the count cache so any time it's encountered it will return a cached 1
Anyone else notice the presents are being drawn exactly like day 13 anon’s “ice blocks” from the puzzle beta he posted earlier today? Like both puzzle inputs involve a series of grids of # and .What a striking coincidence that is
Divinity with Eric ended, I worship Duck Eric now.
there's no way the greedy way is correct>on previous years we would've had to calculate all available space under each tree
I was trying to get rid of that last parsing line without copying it and reading the input 10000 times, but fuck it. If eric didn't care about todays puzzle why should I?
>>107523657The ice blocks I mean: >>107516440
>>107523657pretty common for aoc puzzles.
>>107523661Yeah, compare the final day of EC (triangle trampolines) to this lol. The EC string art was actually fun too, sadly there weren't many good visuals to create from this year's AoC.
>>107523657it reminded me more of an anon and his transported presents marked as fragile
I'm thinking this is recursive backtracking but there are so many state variables I am having trouble setting it up. Or is there some way to create the optimally packed shape for each combination of shapes to reduce the number of tilings to try.
>>107523666>heres your functional programming bro
>>107523705Lol, see>>107523320
>>107523710It's called 'Pythonic'
I FUCKKKING LOVE ITTT GOD DAMN IT ERRICC HAHAHAHA!! :D Merry Christmas Boys! Hope you got all your Stars! I'm not even gonna post code for that last one. It's actually hilarious and based. I can't spoil that! See you next year! Thanks for a fun time!
>>107523714Fug, I consider myself filtered for the amount of time I have spent setting this stupid shit up. Just kill me.
I AM going to make it.
has anyone solved this puzzle for real btw?>Part 2, What is the smallest area the set of blocks can fit into
>>107523733best /aocg/ content of the year.
>>107523733zased
>>107523733SOVL.
KINO CONFIRMED
>>107523000>>107523004merry christmas to you too showtime anon.
>>107523733kek omega based.
>>107523425i didn't need a leap of faithi checked how many definetly fit by putting 3x3 side by sidethen i checked how many definitely don't fit, those who don't have enough space even if you could tile them perfectly covering the whole spaceeric totally jewed us with this one
>>107523733LOL, well done
>>107523511I didn't think we would get the full days, but I at least though he would do a true 2-parter today and have the cash-in star be a "secret" third star, just to make the numbers aesthetically pleasing with 25 stars, especially on the [Events] page where you see your total stars across all the years. If he had done that it would still be some multiple of 50 every 2 years from now on. This 24-star shit is triggering my autism.
what the FUCK I implemented the solver for this piece of shitis this just to troll AI users?
>>107523803I mean even if you do that the example shows interlocking and rotation. Unless the tiles can form a perfect divisible fill you'd have to try rotations. Or at least attempt the total vs shape area.
I started to get suspicious when I saw some of the numbers in my input looked like a lot of pieces to cram in there, but I didn't think it would be that dumb of a cheese. Oh well.
>bump limit>page 8good riddance goodbye /aocg/
>>107523510Tiling and packing problems like this are extremely hard in general.For the restricted case with 3x3 shapes there might be some specialized algorithms to do it (a lot of the shape can pack tightly into rectangles, which will probably help), but in general there's no chance. Even strip packing, where all shapes are rectangles from the start, doesn't have a reasonable approximation algorithm.All in all, shit puzzle, shit year. Thankfully this is the final one (except the extra puzzles that will definitely happen).
>>107523848At least one more thread will be made, party's not over yet
eric you hack fuck you for this troll problem that I spent so much time on. fuck off. everybody codes better and I will do that from next year. fuck you
here you go>>107523907>>107523907>>107523907
>>107523904this and unironically
>>107523025why limit it to only primes?>>107523032so this was just a last cash grab year?>>107523189nice on that guess, anon>>107523099(Me)with the wasted dubs and a disappointing anticipation. I should have just stayed and looked at the simple guess solutions. or should have guessed myself from so many fast solves on lb
>>107523554I noticed this too and just balled. curiously I had already printed (m//3)*(n//3) - sum(counts) while exploring and that was the correct ans fuck this shit
>>107523948>so this was just a last cash grab year?i guess soi think the reason he is now enforcing strict copyright regulation is in the hopes he can sell it off to someone else, which i honestly wouldn't mind if whoever he sells it to then relaxes the copyright again
Fuck it we're making our own AoC>>107516440Holy SOVL, I love the writeup, part two could do a better job of flipping your part1 solution on it's head, I reused it and it was too simpleThe instructions are ambiguous on how air propagates, common sense says directly adjacent but a note clarifying that diagonal adjacency doesn't count would make it retard proof
>>107523948>why limit it to only primes?Because gcd doesn't work
>>107523431When you say "3x3 blocks available", do you mean non-overlapping blocks? Or overlapping, as in, subgrids within the main grid? I think you meant the latter, but what did you mean?
>>107524067non-overlapping
>>107524048I meant try all factors of gcd, not just primes (in descending order)
>>107524071I'm so close... but all three cases pass because the conditions are always met...https://pastebin.com/P5Qv5nw3
>>107524112what are you doing anon? it's not worth it. think of the easiest way to arrange the presents (think no overlapping at all and presents are all 3x3). no matter how hard you try to arrange the presents unfortunately there will be no present left for you at the end of it :<
>>107523359>>107523397>>107524162No way, is it basically to assume that all presents are 3x3 always?
>>107524184yes, fortunately or unfortunately. can't imagine the horrors if that wasn't the case
>>107521930you broot every way from your input to SOME fully even state by pressing every button only once, not necessarily subtracting every counter only by one
>>107523980>now enforcingHe's disallowed it forever, but never did more than ask nicely for people to not share until someone went absolutely ballistic at him for it
>>107524441he took down the repo of some LLM cheaterhttps://github.com/hugoromerorico/advent-of-code-24
>>107523839>the exampleyou don't need to solve the example
>>107523428>solve eric's puzzles and give us the solutions>do it in RTL so we can use your work for publications or other bullshitno fucking thank you. my day time job is RTL, I'm not doing AoC in RTL as well. That wouldn't help me do anything but waste time implementing solutions that should never be done in RTL
>>107524456And? That was after the incident and he made it clear he would.
>>107524441>until someone went absolutely ballistic at him for ithe deserves being called out for it. He is a dumbfuck for it. You wouldn't defend any business doing this shit to their customers.
>>107524537>And?and he is a dickhead for that
>>107524622Calling out is one thing, being an incompetent dipshit to the one person who legally has teeth to respond about it is another.Sharing inputs/text wouldn't even be a discussion if not for that sperg since he wouldn't have drawn so clear of a line in the sand. Prior to that inputs were widely shared without being taken down.
every time I feel like I've thought of an optimization I realize why it's too naive and would create false negatives. is this just O(fuck)?
I never thought that I'd be googling "polyominoes tesselation" but here we are, 30 minutes later realizing it wouldn't work and that solution is counting the squares
>>107524962nevermind, fucking hell god damn it eric