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


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 1734079922895587.jpg (464 KB, 1920x1080)
464 KB
464 KB JPG
advent of math edition

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

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

previous thread: >>103497953
>>
File: solve.png (374 KB, 5224x2022)
374 KB
374 KB PNG
idiomatic Rust solution
>>
TOTAL ELF DEATH
>>
>>103503639
>wow new thread
>what could possibly be the first response
>see this
color me surprised
>>
>>103503653
>mad because he isn't the first
>>
love elves
care for elves
hug elves
tell elves you love them
headpat elves
>>
>>103503639
dude you stink
>>
File: day13_matrix.png (24 KB, 721x187)
24 KB
24 KB PNG
>>103502341
using bqn-libs/matrix
>>
>>103503673
YES!
>>
File: idiomatic_calendar.png (3.33 MB, 9853x4116)
3.33 MB
3.33 MB PNG
official /aocg/ calendar
>>
>>103503635
I always appreciate OC but it feels wrong to include another spongebob in the calendar
>>
File: 1734097327250.gif (3.39 MB, 498x498)
3.39 MB
3.39 MB GIF
>by this time tomorrow, mathlets will be purged from the thread.
took longer enough. Bye bye!
>>
>>103503695
yup, that was my initial brootforce thinking as well. tested it a bunch and found nothing then I discarded that idea
>>
File: day13_clean_border.png (33 KB, 865x115)
33 KB
33 KB PNG
washed to remove branching, we /functional/ now

>>103503682
hello fellow arraybro
>>
well, uh, that was easy as fuck?
>>
>>103503876
Yeah, is the difficulty going to rank up at all this year..? Been smooth sailing so far
>>
>check leaderboard day 13
>1) Dec 13 00:00:56

cool, LLMs are fucking back again.
>>
>Hours of searching for a bug in my code
>Correct on the example, too small on the input
>Blame everything from bad math to floating point precision errors
>All these hours I was reading sample data and was to retarded to just print out the values I read
Today I discovered I have a pajeet level IQ.
>>
>>103503936
>floating point precision
...nigga why are you using floats?
>>
>>103503912
daily reminder that there are people in this thread who are dumber than LLMs
eventually this will be the fate of all of us, but the fact that it already happened for a significant portion of the population is surprising
>>
>>103503939
nta but

>invert matrix
>multiply by XY values
>check if int
>>
>>103503947
>llm
>smart
retard
>>
>floats
you didn't solve it
>>
>>103503965
how else
>>
>>103503960
>nooooo it's just heckin predicting the next worddd
a company could use it for the same reason it could use you therefore you are no better.
>>
>>103503939
Extra source of bugs makes it more interesting
>>
>>103503965
>needing conditional logic because you don't understand float precision

Sad!
>>
>>103503975
ints
>>
>>103503976
retard
>>
>>103503975
see >>103503639
>>
>>103503975
The matrix solution works with ints too, instead of checking if the solution is an int you test if the solution given by the inverse is actually a solution
>>
>>103504000
Explain me why I should ask you to solve a problem when I could just use an LLM.
>>
File: 1725770492948635.png (243 KB, 1938x1204)
243 KB
243 KB PNG
>>103503939
Because I was using import solution (simd).
Feels nice to have all this shit in the standard library.
>>
>>103503975
Here are just ints
>>103502810
>>
>>103504013
>hey guys, here is a daily coding challenge you can solve if you want
>why should I solve a problem that already has a solution?
you do you
>>
>>103504095
Nigger you're arguing that smart means some muh sovl human thinking
I argue that what it really means is being able to efficiently solve problems, finding solutions to them
Therefore it's not wrong to say that LLMs are smarter than many humans.
>but what about today probl- ack
nobody talked about that
>>
>>103504122
> cant win an argument
> starts swearing
I see what you are trying to do.
btw, you cant use LLMs with such derogatory language
>>
>>103504132
I literally just won it.
You failed to prove any of the points I made in the post you replied to wrong, thereby admitting you're unable to.
I was swearing because it's disturbing how your comprehension is extremely slow, make random statements with no connection to the subject of the argument whatsoever and you're still so arrogant.
>>
>>103504149
> fail to address any of my points
> thinks he wins
sigh. so tiresome.
yeh keep at it buddy.
>>
Was today intended to filter self taught cucks?
>>
>>103504156
Eric targeted brute forcers.
>>
File: day13.png (117 KB, 1600x692)
117 KB
117 KB PNG
Today feels like a joke. I thought the 10-20 days were supposed to be hard?
Which anon is building the big boys? You should throw in some zero-sol and infinite-sol problems so that people have to handle edge cases. The former would be pretty easy to handle, the latter would be awful and PROBABLY SHOULD HAVE BEEN PART 2 IN THE FIRST PLACE.
>>
>>103504156
damn it feels good to be a game dev
>>
File: 16b45b645.jpg (91 KB, 900x900)
91 KB
91 KB JPG
>someone out there is shitting and pissing themselves as they try to understand simplex
>>
>>103504176
>bigboys for an O(1) problem
>>
speaking of today, any good linalg libraries for rust?
>>
>>103504154
My arguments:
>there are people in this thread who are dumber than LLMs
>what smart really means is being able to efficiently solve problems, finding solutions to them
Your arguments:
>llm can't be smart
>retard
>hey guys, here is a daily coding challenge you can solve if you want
>why should I solve a problem that already has a solution?
I asked
>Explain me why I should ask you to solve a problem when I could just use an LLM.
in general, your response was some greentext bullshit about coding puzzled and AoC, they have nothing to do with the argument
Now please explain me in general or gtfo.
I guess what your retarded ass means is that LLMs are just outputing solutions for 1:1 existing problems which is bullshit.
https://alphacode.deepmind.com/
>>
>>103504200
>rust?
stopped reading right there
>>
>>103504218
so you read the whole sentence?
>>
>>103504225
yes
>>
Name one time you had to solve a system of equations at your job
>>
>>103504234
My network got hacked with ransomware once which told me that all my data would be purged if I didn't find the eigendecomposition of a 100x100 matrix
>>
>>103504256
numpy.linalg.eig(matrix)
>>
Hey guys what do you think of my solution?
import sympy
'''
rest of code here
''''
>>
Are there any weird edge cases? I've been struggling to fix my part 2 for a while now, so I copied two other peoples solutions, and got the same (wrong) answer.
>>
>>103504234
We had a server with small storage and another one with larger storage, we were storing source code repositories on them.
I knew that a project grows some x1 amount in size a day, and it takes x2 space initially, another one y1 and y2.
It was also true that max(x2,y2)<min(server storage sizes)
We could order another disk for storage, but the sooner we do it costs more.
So I had to calculate when they will be the same space, from then on of course it would be more optimal to store the faster growing one on the bigger disk. But it's possible that until then the smaller one will already be filled. In that case it's better to swap. This way I can calculate which of them will be full first and when. So I could get the new storage as cheap as possible.
>>
>>103504077
>b := b1 / b2
how is that not a float
>>
>>103504256
https://pastebin.com/raw/5J1vGhdA
>>
>>103504256
Not equations, but at my last job I had a project that required coding theory to solve it.
>>
>>103504315
>button values of 0
>buttons are parallel
>rounding errors
None of these happened in my input/solution but could be a gotcha if present
Of course, there's always:
>you somehow corrupted or didn't copy your entire input.
>>
File: aoc_2024_13_b.png (494 KB, 1868x2674)
494 KB
494 KB PNG
Friday, funday.
>>
>>103504156
How self taught do you have to be to not know middle school algebra?
>>
>>103504417
nigga, you don't realize how bad it is out here and I have a degree and work with people who claim to be CompSci degree holders.
>>
>>103504315
floating point precision. I needed to do some annoying trial and error tuning of the rounding threshold, and the "correct" threshold varied depending on the exact form of the formula I used.
>>
File: file.png (51 KB, 658x694)
51 KB
51 KB PNG
I am a python user, who cares about your gay ass coding languages
>>
>>103504383
None of those as far as I can tell.
>>
File: cao cao.gif (1.36 MB, 320x200)
1.36 MB
1.36 MB GIF
>>103504234
LMAO, not everybody is a codemonkey like you.
>>
>>103504447
My solution is in C++ and uses int64_t
>>
>>103504324
>boss, we’re going to need a new drive
>>
I skipped yesterday because it looked like a pain in the ass. Was it actually secretly as easy as today's or is this really just baby shit?
>>
>>103504474
part 1 was easy, flood fill or recursive dfs with a stack worked fine
part 2 i didn't even try because i didn't have time
>>
>>103504474
Part 1 was easy. Part 2 had a bunch of edge cases that were a bit awkward to deal with
>>
>>103504502
holy cope
maybe this event isnt for you bud
>>
>>103504502
You could use flood fill for both. You find all the different regions and handle them separately. For Part A you count every fence segment of each region. For Part B you count every fence corner of each region.
>>
>>103504474
Part 2 is pretty scary but it got much easier once I realized you didn't have to count the edges, you just had to count the corners
>>
>>103503954
It's a 2×2 matrix inversion. You can do it symbolically for the general case.
>>
>>103504526
Counting the corners took me a while and my code was awful. I'm not going to lie to you, I thought D12 was going to be my filter.
>>
Not posting the code I used to parse the input
solve2x2LinearSystem (LS2x2 x1 y1 r1 x2 y2 r2) =
let factor = negate (fromIntegral x2) / fromIntegral x1
y3 = fromIntegral y2 + (factor * fromIntegral y1)
r3 = fromIntegral r2 + (factor * fromIntegral r1)
m = r3 / y3
n = (fromIntegral r1 - (fromIntegral y1 * m)) / fromIntegral x1
in (n, m)

validSolution (n, m) = smallDelta n && smallDelta m

-- is the number whole with a sufficiently small delta?
smallDelta f =
let r = round f
in abs (f - fromIntegral r) < 0.0001

data LinearSystem2x2 = LS2x2
{ lsx1 :: Int
, lsy1 :: Int
, lsr1 :: Int
, lsx2 :: Int
, lsy2 :: Int
, lsr2 :: Int
}
deriving (Show, Eq)
>>
File: image.png (240 KB, 828x340)
240 KB
240 KB PNG
>>103502376
cleaned up my humble BQN solution a tad bit
>>
Oh cripes, I think it was just because I wasn't using floats?

This is why computers are worthless trash, oh teehee that number is to big for my int, better round it and do throw out some random shit instead.

https://www.youtube.com/watch?v=s_C0IjjEz2E
>>
>>103504538
>he counted up instead of down
>>
>>103504612
How would you store 1/3 nigger?
Write your own class if you want to do operations with fractions, it's easy until they are rational.
Just multiply the numerators and denominators and always divide by gcd.
>>
>>103504447
C++, no floating point:
#include "aoc.h"
int main(int argc, const char** argv) {
if (argc != 2) return puts("Missing file name"), 2;
MmFile in(argv[1]);
if (!in.α) return puts("Failed to read file"), 1;
def problems = in / "\n\n" * λx(ϙNg(x));
const Z cost_a = 3, cost_b = 1, num[2] = {0, 10000000000000};
Z res[2] = {0};
ɤi (2) ɤc (problems) {
const Z ax = c[0], ay = c[1], bx = c[2], by = c[3],
x = c[4] + num[i], y = c[5] + num[i];
def den = ay * bx - ax * by;
if (den == 0) continue;
def num = y * bx - x * by;
def a = num / den;
if (bx == 0) continue;
def b = (x - a * ax) / bx;
if (a * ax + b * bx == x && a * ay + b * by == y)
res[i] += a * cost_a + b * cost_b;
}
$o res[0], res[1];
}
>>
Man, that took forever. I haven't done algebra in years, and when I realized how easy this really was many, many hours had passed.
>>
>>103504612
>This is why computers are worthless trash
Accidentally having an overflow error is one thing, but acting like it's the computer's fault is another. Literally day one programming knowledge.
Use a language with bigints like python if you are uninterested in how a computer actually works.
>>
>>103504729
At first glance I thought this was some variant of the backpack problem so I started reading on how to solve it with dp and not until I read it again a few times did I realize...
>>
>>103504234
I write software for industrial scanners, so all the time actually.
>>103504474
It depends on how smart you are.
Good solutions for part 2 are only a few lines.
>>
>>103504662
Huh. That's an interesting idea.
>>
>>103504759
>It depends on how smart you are.
uh oh
>>
>>103504749
I've been looking at part 2 on and off during work, so I never really sat down and thought it through. It was easier to just autopilot my way through it which produced a big fucking mess.
>>
>>103504749
rookie mistake, if there's a dp problem on day 10-12 there won't be another dp problem until at least 15
>>
>Sounds like an easy and fun problem to compute on a GPU
>Double precision is required
Nevermind
>>
>>103504345
The results we're trying to get are discrete units. Coincidentally, b2 should always be divisible to b1.
>>
>>103504474
It was extremely easy as long as you realized you could count edges and corners during the flood fill.
>>
>>103504801
I just rounded and checked if the rounded answer was correct
>nooooooo stop you can't do that
That's what I did though.
>>
solve = ap (ap . (liftM2 ((.) . (.) . (.)) .) . flip flip id . ((flip . (liftM2 (,) .)) .) . flip (flip . ((flip . ((/) .)) .) . flip ((.) . (-)) . (*))) (ap ((.) . flip . (liftM2 ((.) . flip . ((/) .) . (+)) .) . flip . ((*) .) . flip ((/) . negate)) ((((+) .) .) . flip . ((*) .) . flip ((/) . negate)))
>>
>not a single hard puzzle yet
>more than 90% of participants dropped out already
>>
>>103504662
This is genius actually. Added to my mind palace of puzzle solution techniques.
>>
File: img-2024-12-13-16-57-55.png (2.16 MB, 9848x4120)
2.16 MB
2.16 MB PNG
>>103504926
forgot image
>>
>>103504940
At this point I think the "easy", "medium", "hard", etc. labels are just misnomers for what information the plot is actually trying to convey.
>>
>>103504940
First hard problem today. (Don't worry, it won't actually be hard, it will just be djikstra)
>>
>>103504940
> 2015 day 1
> insane
what? https://adventofcode.com/2015/day/1 is "insane"?
What do the colours actually mean?
Is it number of people who completed part 1 but not part 2 of a day?
>>
File: img-2024-12-13-17-22-40.png (911 KB, 6016x2060)
911 KB
911 KB PNG
>>
>>103505179
How long it takes for the leaderboard to fill. Which took forever when AoC was new and few knew about, and really, really fast now with LLMs
>>
>>103504662
explain please. I am too dumb to get it
>>
sorry about jpg, it's already too big in png
changed spongebob from day 12, can revert it if you want
>>
>>103505179
If difficulty is going to be graded on time, it should be graded on a curve, per year.
>>
>>103504345
because in my language
type int / type int = type int
it truncate the value.
>>
>>103505256
please revert. That was when noone made an effort to post images and I made an effort to try and think of a good joke.
>>
File: sweaty.png (16 KB, 600x246)
16 KB
16 KB PNG
>>103505179
i'm positively sweating with how difficult this one was, phew
>>
>>103505256
day 4 looking especially based
>>
>>103505247
p1 = perimiter = 4 * area, count down
p2 = sides = perimiter, count down
>>
>>103505329
I still don't get it
>>
>>103505329
sorry, I am still retarded.
>>
>>103505329
Just do all of it during the flood fill. The number of iterations is the area, the number of times an element that isn't part of the current shape is encountered is the perimeter and the number of corners (which can be counted by looking at the moore neighborhood of each point) is the number of sides.
>>
>>103505329
post code nigger
I don't think the second one is straightforward at all
What's the exact logic to decrement the counter?
Much easier to just inflate the grid...
>>
>>103505430
sure, but I want to be enlightened by this 'count down' strategy, sounds interesting.
I still dont get it.
>>
>>103505432
if you change your attitude by the 25th i'll consider it
>>
>>103505456
that was just someone else with a drive by comment. I am the original guy who asked. please share :(
>>
File: find_x.png (11 KB, 445x322)
11 KB
11 KB PNG
Today's challenge: Find the red dot
>>
>>103505456
nigger
That was my first idea as well but there were too many cases to consider so just didn't give a fuck and inflated the grid. Not filtered, cope and seethe
nigger
>>
File: Capture.png (18 KB, 494x402)
18 KB
18 KB PNG
>>103505471
got it for you champ.
>>
File: img-2024-12-13-17-54-28.png (245 KB, 1280x922)
245 KB
245 KB PNG
>>103505471
>>
File: day13.png (22 KB, 511x252)
22 KB
22 KB PNG
Easy, but took me far too long because of the irresistible urge to use a matrix inversion to solve part a, which escalates into the need for a rational number class, and then big integers in part b.
Reverted to manually solving in 64 bits, which is almost trivial.
>>
>>103505485
>>103505487
You got a gold star!
>>
File: Capture.png (816 B, 95x26)
816 B
816 B PNG
>>103505495
Holy, thanks Eric!
>>
>>103505493
Lol no, you can do matrix inverse, you just have to wait to divide by the determinant until after you multiply the "inverse" with the vector.
e.g. A^-1 = A' / det A, then just do A' * v / det A

Also fuck the makers for not including any tough cases in the input.
NO negative solution cases
NO rational solution cases
NO infinite solution cases

I mean wtf, I wasted half an hour implementing a full solution and it's not even being tested and you retards get to just invert a matrix.
>>
>>103505613
Is this your first time doing aoc?
>>
>>103505329
what is this count down tech? does anyone know?
>>
>>103505661
It's retarded and overcomplicated, that's what it is. Just count corners
>>
>>103505468
He's just a pathetic loser who likes to play the smartass on an anonymous imageboard by speaking in half-words and expecting others to get it
He didn't actually solve it that way, and even if he did he would be embarassed to post it because it would be instantly clear that his solution is actually more complicated rather than simple than others'/alternatives
>>
>>103505688
I think you are correct. sad though, thought there was another interesting way of approaching that problem
>>
>>103505626
Yeah pretty much
>>
File: img-2024-12-13-18-29-16.png (891 KB, 9024x3090)
891 KB
891 KB PNG
tragic
>>
>>103505661
iterate over every square in a region, and look in every direction from that square. If the neighboring square isn't of the same region (or it outside the grid) then add to a set of squares that face in that direction.
once you have four sets of squares for the region (no need to dedup), for each: start outside the bounds of the grid with a toggle set to false, and then scan across the grid, toggle-on when you hit a square. Increment border count and toggle-off when you stop hitting a square.
>>
>>103505858
holy shit, that's retarded
>>
>>103505858
cornerfags, your rebuttal? As someone who hasn't done day 11 this sounds like cancer.
>>
File: solve.png (889 KB, 5546x4232)
889 KB
889 KB PNG
>>103505858
Just count corners dude
>>
File: 2024-12-13_17-40.png (148 KB, 1064x1053)
148 KB
148 KB PNG
corejavabros I was busy but thankfully Eric cooked us a trivial puzzle for today
on that note the inputs were especially lame:
- no div by 0 to worry about
- no part 1 solutions with >100 presses (why put that in the problem statement then?)

oh well, see you tomorrow
>>
>>103505971
>no part 1 solutions with >100 presses
That's literally what the description says though
>>
>>103505858
First of all congrats, this is the most complicated one of all solutions I've seen so far
Second, how is this counting down, you literally start from zero and increment it
I was right, you're a retarded nigger
>>
>>103505858
>>
>>103505858
original asker here.
Holy that sounds overly convoluted and not smart. I just counted corners.
>>
>>103505885
Unreadable
>>103505971
Beautiful
>>
>>103504324
>>103504471
kek imagine doing all this just to save some shareholder a few bucks. Just put the hard drive in the cart bro
>>
File: 2024-12-13_17-47.png (109 KB, 958x856)
109 KB
109 KB PNG
>>103505990
yeah, it should have had them and this be a rule to exclude some solutions
what an odd guarantee on a problem that is already O(1)...
well, then the result is even neater, at least

>>103506034
you are cute, anon
>>
>>103506023
just fyi, you asked me, I did not provide that answer. it's also wrong
>>
>>103505613
>Lol no, you can do matrix inverse
I know, I solved it that way, but needed rational numbers in my matrix, and for part b 64 bit based rational numbers overflowed during the inversion, so I had to include a library for large numbers. After solving both parts this way, I said fuck this shit, dropped the library dependency and wrote an 8 line solution without matrices that works in 64 bits. Waste of my time.

>NO negative solution cases
>NO rational solution cases
>NO infinite solution cases
How do you press a button negative or a rational number times?
I only considered that there might be cases with more than one solution, so you would have to ACTUALLY minimize the cost, but there were none.
>>
>>103502999
>>103503021
i have calmed down and retract any death threats
i came up with my own solution unrelated to the O(1) direct equation shit everyone else is posting
>>
File: carbon.png (338 KB, 1664x1052)
338 KB
338 KB PNG
>>103504200
nalgebra came in handy on day 24 last year.
>>
File: code.png (322 KB, 1478x2188)
322 KB
322 KB PNG
Python
>>
>>103506155
nice ok
>>
>>103506083
at this point I am just accepting that you are baiting me.
>>
What even is the corner technique? My approach was

>for each tile in shape (stored as a set), find the 4 adj tiles
>filter to the ones not in shape
>each in-out pair is a fence
>save, structure is two hashmaps (for y-lines and x-lines), each maps a line constant to the points on that line (stored as btrees for auto ordering)
>e.g. if you have (4 7) in and (4 8) out, you have the line x=7.5 at point 4, so you save it to x_lines[7.5][4]
>(actually it was easier to save a (7, 8) tuple rather than the float but you get the idea)
>to count sides you simply iterate over each btree and count the breaks + 1
>>
File: 2024-12-13_19:05:38.57.png (130 KB, 897x991)
130 KB
130 KB PNG
could someone explain why mine isn't working?
i'm pretty sure my math is correct based on what i've written on a piece of paper but it only works on part 2 and I get 0 for part 2 all the time
>>
>>103506297
not reading all that, but I am happy for you
>>
>>103506297
the number of corners in a polygon is equal to the number of sides.
>>
>>103506295
i will give you a hint
you start with the assumption that the perimiter is = num cells * 4
>>
File: 1724843623647264.png (3 KB, 783x825)
3 KB
3 KB PNG
>>103506297
>>
>>103506302
Theoretically could be because 10e12 is double, but it should still be small enough to be fine.
>>
>>103506330
>>103506376
Seems way more complicated to match specific patterns vs a simple count
>>
>>103506443
>>103506302
figured it was unsigned long long. changed to int64_t and it works fine. replaced the 10e12 to a number with 0s just to be safe though.
>>
>>103506376
Depending on how you solved the rest of the problem it could be pretty unfeasible to identify examples 3 and 4 on there. I ended up having to count sides by finding discontinuities in border regions.
>>
>>103506452
>>103506467
A count_corners function on each point that looks at a few adjacent pixels is definitely easier than hashmaps and shit. Probably not more efficient, but definitely simpler.
>>
>>103503635
struct machine {
std::pair<int64_t, int64_t> button_a, button_b;
std::pair<int64_t, int64_t> prize;
};

int64_t solve(machine m, bool gold) {
if (gold) {
m.prize.first += 10000000000000;
m.prize.second += 10000000000000;
}

int64_t a_x = m.button_a.first, b_x = m.button_b.first;
int64_t a_y = m.button_a.second, b_y = m.button_b.second;
int64_t p_x = m.prize.first, p_y = m.prize.second;

int64_t a_presses = 0, b_presses = 0;

int64_t determinate = (a_x * b_y) - (b_x * a_y);

int64_t determinate_x = (p_x * b_y) - (b_x * p_y);
int64_t determinate_y = (a_x * p_y) - (a_y * p_x);

a_presses = (int64_t) determinate_x / determinate;
b_presses = (int64_t) determinate_y / determinate;

if (!gold && (a_presses > 100 || b_presses > 100)) return 0;

return (int64_t) (a_presses * 3) + b_presses;
}


i'm filtered. i cannot figure out why this shit doesn't work, though at least i got a refresher on basic linear algebra today.
>>
Guys would c# be based and red pilled for solving AOC problems? Getting tired of my current language
>>
>>103506549
integer division
>>
>>103506561
don't evaluate languages on basedness and redpillness. just use whatever you want without additional affirmation. if you don't like what you use now then just switch.
sidenote: haven't seen any forth solutions this year
>>
ZjJCNU5oNHI=
>>
File: C_irno.png (476 KB, 800x926)
476 KB
476 KB PNG
>>103506549
use doubles, anon kun
>>
>answer too low
I need test cases. I need edge cases.
>>
>>103506549
i'd try to condense the equations to a single variable assignment since the intermediate parts of this might need to be float/double to yield correct result.
>>
>>103506583
cGFzdGViaW4=
>>
I'm getting filtered hard by yesterday part 2. My code is correct on the example but fails too high on the input. What edge cases could I be missing?
>>
>>103506663
WWWUWWW
WUWUWUW
WUUUUUW
WWWWWWW
also test this pattern rotated 90, 180, 270 degrees
>>
>>103506663
Did you try all the examples?
>>
>>103506583
>>103506627
>A condensed dox for Crystal Shaw-Gallagher; reason is I got confirmed info and
wanted to not muddy up and to make a condensed DOX for you guys.
MOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOODS
>>
>>103506690
What kind of compression is that?
>>
>>103506707
https://www.rapidtables.com/convert/number/hex-to-ascii.html
>>
>>103503635
>has a terrible headache and eye strain
>read day 13
> ...
>import sympy
>>
>>103506682
yep, every one correct
>>103506680
thanks anon
getting 19 * 16 + 9 * 12 = 412 for all rotations
>>
>>103506297
during the flood fill whenever you encounter a new point p in the shape, for each of (x y z) in (w nw n) (n ne e) (e se s) (s sw w) count if x != p && z != p or y != p && x == z == p.
>>
File: aoc-2024-day-13.png (1.4 MB, 1400x1047)
1.4 MB
1.4 MB PNG
back to school day. had to eyeball eps, but it worked eventually.
>>
>>103506801
>had to eyeball eps
total machine constant death
>>
>>103506801
cute
>>
>>103504225
how would he know, he stopped reading
>>
>>103504225
what if he's jewish and reads right-to-left?
>>
File: file.png (10 KB, 653x34)
10 KB
10 KB PNG
this is the modern c++ version of being a three-star programmer
>>
>>103506690
Key: S K A I X M T P O N R H X U S T B L L G H V I D D T C X Y L R U S Q K M Y J A W M R R G B Z F D M U G (secret)

Cipher: A W A O F Z X Q S V E N P I S G H C J Z O V B B R N E L S W U H L V S Z G B H P T V X X F D S W Q R Z (cipher)
>>
>struggle solving system of equations in text editor for over an hour last night
>Today, get out pen and paper
>Solved in 10 minutes

Tbh I'm not sure if I would have thought to set it up as a system of equations without skimming this thread a little. Oh well, still not filtered.
>>
I need help with part 1. I must be missing something obvious here, reading comprehension.
Even by broooooot solution is incorrect.
I've got at most 100 moves. Use it to make n A presses and m B presses. If resulting coordinates match the prize - that's it. Update current score for machine, pick minimum.

do I need to call pannenkoek2012 to solve it in half a press?
>>
>>103507042
>I was filtered
>Oh well. Still not filtered
What did he mean by this?
>>
>>103507027
Paste this into chat gpt.
>>
>>103507066
I'd prefer perplexity.
>>
>>103507055
It's 100 A + 100 B, not 100 (A+B)
>>
>>103507042
> 10 minutes
There are little Asian girls who can do it faster.
Shame on you.
>>
File: bqn.png (52 KB, 855x344)
52 KB
52 KB PNG
>>103501744
cleaned up my BQN a bit
Det fixes Solve
had way too much trouble figuring out how to add a 3x2 array to a 320x3x2 array
>>
>>103506801
LMAO, imagine needing floating point just because you divided by ax instead multiplying by ax.
>>
>>103507092
Thanks. Of course it works now. That's embarassing.
>>
File: IMG_6542.jpg (273 KB, 1170x814)
273 KB
273 KB JPG
>>103507027
You alright?
>>
>>103507116
Yes, actually used Modular arithmetic
>>
>>103507116
Probably didn't decrypt it well enough.
>>
>>103507116
use a Vigenere table
>>
who the FUCK is cramer
>>
>>103507220
What's the deal with airplane food?
>>
>brooters filtered
>mathlets filtered
What is the next filter?
>pruning
>sparse-grid (idk what do call this. There is usually a day where you have to come up with your own representation of data rather than the naive one)
>crt/cycles
>pathfinding (last time didnt count)
>>
https://files.catbox.moe/vm3fox.7z
Part 1: 149855743
Part 2: 307182016825147830
>>
>>103503965
all numbers in awk are stored as strings, then parsed into floats as needed, then stored as strings again

therefore the idiomatic way for me to check for float vs. int in awk is a regex to search for a period.
>>
>>103507246
There'll probably be a travelling salesman-like problem at some point where you need to find the particular heuristic needed to make it run in a reasonable time.
>>
File: bqn.png (52 KB, 894x355)
52 KB
52 KB PNG
>>103507102
washed^3
dunno if this is better but it's a little less obscure
>>
>>103506152
>I only considered that there might be cases with more than one solution, so you would have to ACTUALLY minimize the cost, but there were none.
I thought this too but is it even possible to have multiple solutions given that A MUST be exactly 3 times B?
>>
>>103507282
networkx.traveling_salesman_problem()
>>
>>103507246
>makes a simple memo hashmap and finds the intersection of two lines
>WAOOOW GET FUCKED CODELET RETARDS FILTERED FILTERED FILTERED
>>
File: file.png (1.19 MB, 800x800)
1.19 MB
1.19 MB PNG
can't believe I had to draw this spastic graph to figure out what was wrong (I'd set one of the lines coords to XX not XY FUYUUUUUUU
>>
>>103507246
Just waiting for the token Dijkstra day
>>
File: 13-binary-search.png (306 KB, 909x1476)
306 KB
306 KB PNG
>>
File: tgf.png (825 KB, 2039x2117)
825 KB
825 KB PNG
>>
>>103507336
allow me to explain:
1. mathlets get frustrated by the problem, then realize it's not only easy but HS math
2. mathlet now has hurt ego, but is too ashamed to admit at failing HS math
3. mathlet launches flurry of attacks ON MATHLETS, partially to spread pain around, but mainly with the hope that someone will righteously BTFO these anti-mathlet attacks, giving the mathlet some protection against his own shame
>>
File: mamamia.jpg (30 KB, 750x573)
30 KB
30 KB JPG
>mfw I sieved 100,000,000 primes yesterday for this problem
>>
>>103507246
Elfular automaton and interpreter/reverse engineering.
>>
>>103507246
reverse engineering assembly
>>
>>103507057
>he didn't invent basic math by himself
filtered
>>
>>103507246
linear programming which people will attempt to broot with dp
>>
They are not difficult at all but I hope we get an interpreter problem. Those are lots of fun.
>>
>>103507247
silver: 148299183
gold: 307163681484817759

I did it with sympy for arbitrary precision so you may have rounded wrong somewhere
>>
>>103507387
this was literally primary school level math. early primary school.
>>
My dyscalculia-having ass trying to figure out the problem today.

Still not filtered, though.
>>
>>103504234
Not everyone works as a library and api plumber
>>
>>103507595
Maybe in Asia. A lot of American kids only learn this kind of shit in middle or early high (!!!) school.
>>
>>103507371
If I unfilter myself on day 12 before Christmas, will this reflect that? Asking for motivation.
>>
>>103507724
no, but another anon posts a version without the 24h limit
>>
>>103506690
If you're too lazy to decrypt here's the plaintext

I M A G I N E B E I N G S O A N G R Y T H A T Y O U C O U L D N T F I N I S H T H E G R E E N T E X T (decrypted)
>>
File: file.png (46 KB, 1200x1200)
46 KB
46 KB PNG
Let's go gambling!
>>
>>103507768
Key: P X T B Z Q H L B I E R L L P C Z L E H O E Y W P P A C T F W M K S S W E E F H S X V E P L M V W M D Y N N C R A N O N A A G (secret)
Cipher: P J V P T B K Y P B A R Y O T T Z X G V I P B J D I W Q G I A D K E U K Y P I U G Q W I A Z Z B D Q F M H Y F D E E S Y Y B K (cipher)

Here have a goodie.
>>
>>103507768
are you esl perchance?
>>
>>103504234
>I can only value things through the lens of my job
American moment. You don't have to have kids for your job. You don't have to browse 4chan for your job. You don't have to make a nice meal or clean your room for your job.

You don't have to kill yourself for your job, but I still think (you) should.
>>
File: 2024-12-13_20-29.png (78 KB, 1228x483)
78 KB
78 KB PNG
>>103507247
I knew my parsing was shit but not how much
now I know

>>103507589
I get the same values as him tho, working with longs/doubles after parsing
>>
>>103507595
Technically, but it's a lot of basic algebra rules to chained together. It's easy for an adult who hasn't done this shit for 5+ years to fuck up somewhere and assume the problem can't be solved with algebra, and that's assuming they tried it in the first place. Look at empirical measures like average tts or star drop-off rate. This isn't as easy as you're trying to make it seem just so you can validate your belief that everyone but you is stupid.
>>
>>103506580
There was apparently a Forther on yesterday. Posted an old one.

>>103498730
You should use the rstack and exit more. All the juggling is no bono. Personally I dislike all the wasted vertical space too.

There's not really a need to compile a read-input word if it's only used once.
create input
s" input" r/o bin open-file throw
dup here unused 2/ rot read-file throw
allot 0 c, close-file throw
here 1- constant eof
eof input - constant len

Apparently `unused 2/` is about 4 megabytes in gforth. If you like you can replace it with `40000` again.

Though there's also just `slurp-file`, which `allocate`s from the heap instead of the dictionary. Also, `within`!

I gotta post the rest of the code separate, 4chin dislikes the post length.
>>
I survived another day, but had trouble forcing myself to do another puzzle. I feel I am burning out.
>>
>>103507917
It's all of course untested.

s" input" slurp-file 2dup +
constant eof
constant len
constant input

: parse+ ( na-na) \ keep addr in rstack:
dup >r c@ '-' = if r> 1+ >r -1 else 1 then
( nsum sign ) 0 0 r> -1 >number
drop >r drop ( unum ) * + r> ;

: num-char? ( c-f) dup '-' =
swap '0' '9' 1+ within or ;

: solve-a ( -n) 0 input begin
dup eof < while
dup c@ num-char?
if parse+ else 1+ then repeat
drop ;

jis-create jis
defer parse-array
defer parse-object

: remaining-cases ( nj-n0) case
jis.number of + endof
jis.start-array of parse-array + endof
jis.start-object of parse-object + endof
. 1 throw endcase 0 ;

:noname ( -n) 0 begin jis jis-read case
jis.end-array of exit endof
jis.string of 2drop endof
remaining-cases endcase again ;
is parse-array

\ if found, clear final mask for object sum.
: still-not-red ( fnau-fn)
s" red" compare 0<> rot and swap ;

:noname ( -n) -1 0 begin jis jis-read case
jis.end-object of and exit endof
jis.string of still-not-red endof
jis.name of 2drop endof
remaining-cases endcase again ;
is parse-object

: solve-b ( -n) 0 begin jis jis-read case
jis.error of exit endof
jis.done of exit endof
remaining-cases endcase again ;

input len jis jis-set-string
cr .( A: ) solve-a .
cr .( B: ) solve-b .
>>
File: zscores.png (57 KB, 1088x268)
57 KB
57 KB PNG
>>103505262
I did that here. Time z-scores normalized per year. The problem is you can't get a good read on things when you don't have the hardest problems from this year, making it hard to compare this year to prior years.
>>
>>103504234
the last time I used it at work was when we were on business in that tropical resort and we had to estimate the cost of winning some prizes in the arcade.
>>
File: great_filters.png (129 KB, 1050x270)
129 KB
129 KB PNG
>>103507972
Different way of looking at difficulty, percent of people who made it to the next question.
>>
>>103506549
Make sure a and b presses result in the target coordinates. The 100 threshold is a distraction.
#include "aoc.h"
int main(int argc, const char** argv) {
if (argc != 2) return puts("Missing file name"), 2;
MmFile in(argv[1]);
if (!in.α) return puts("Failed to read file"), 1;
def problems = in / "\n\n" * λx(ϙNg(x));
const Z cost_a = 3, cost_b = 1, num[2] = {0, 10000000000000};
Z res[2] = {0};
ɤi (2) ɤc (problems) {
const Z ax = c[0], ay = c[1], bx = c[2], by = c[3],
x = c[4] + num[i], y = c[5] + num[i];
def de = ax * by - ay * bx;
if (de == 0) continue;
def a = (x * by - y * bx) / de, b = (y * ax - x * ay) / de;
if (a * ax + b * bx == x && a * ay + b * by == y)
res[i] += a * cost_a + b * cost_b;
}
$o res[0], res[1];
}
>>
File: relative heatmap.png (607 KB, 2646x1408)
607 KB
607 KB PNG
>>103507972
>>103508113
Data guy, what do you think of this? It measures percentage of d1 users who were able to get a gold star for a given day and compares it to the same metric for the average year. Data is not really my area so idk if it's useful (or even correct)
>>
>>103507917
>>103507952
Thanks
Though it's been years since I used the language (only used it for that AoC year) so I've already forgotten half of it
>>
>>103507780
you deserve a (You) anon
>>
Eric dogwhistled to storyGODS today that tonight's puzzle WILL be a hex grid. Make your helper functions now.
>>
>>103508160
I like it. One advantage it has over this: >>103508113 is that in my metric, a hard day will have few completions, which makes the day after always look easy (even if it also has a low number of completions, the small denominator from yesterday will drive the number up). Comparing to day 1 completions avoids this problem.

It also matches my experience--yeah, I remember d5 and d12 from 2023 being particularly tricky. But it makes 2020 look way easier than every other year. I didn't participate back then, was it actually easier?

The be-all end-all of a "difficulty" metric is always going to be whether anons look at it and say "yeah that matches my experience."
>>
>>103507952
I did forget to UPCASE all the control-flow words. Easier to read IMO. IF ELSE THEN, BEGIN AGAIN, CASE OF etc.
>>
>>103508160
This is far, far better.
>>
>>103507780
Have my children
>>
File: zig.png (655 KB, 1582x2362)
655 KB
655 KB PNG
>>103507247
panic: integer part of floating point value out of bounds
I get from attached zig with f64 math (406ms):
part1: 160551330
part2: 317188051396904673
and f128 math, 2102ms
part1: 160608250
part2: 317091980627265749
and correct answers for the day. The weird Zig is a translation of >>103507284 which takes 4086ms for these numbers:
159359242
3.169044499997868e17
>>
>>103508241
I believe it
I'll just reuse my code from the hex grid puzzle from a previous year
>>
>>103507801
Qué?
>>
is there a word in the english language that means "not visited" that doesn't start with the prefix "un"
>>
>>103508241

Best tutorial about hexagonal stuff:
https://www.redblobgames.com/grids/hexagons/
>>
Part 1 of yesterday was a cool graph problem by examining the outdegree of each node in a component, but I can't into counting corners at all wtf.
>>
>>103508339
virgin
>>
>>103508264
Sorry, anon. I'm married. To Christmas.
>>
>>103508339
Neglected: describes a place or thing that has been ignored or not visited.
Overlooked: refers to a place or thing that has been missed or not visited.
Bypassed: describes a place or thing that has been avoided or not visited.
Skipped: refers to a place or thing that has been intentionally avoided or not visited.
>>
>>103508348
Anon you can definitely figure it out, just grab some graph paper. If a cell is a top right corner, what is always true about it's upper, right, left and bottom neighbor? Interior corners are a bit trickier but I bet you can figure it out!
>>
>>103508241
>>103508282
Uggghh this is unreasonable! I shouldn’t be expected to know hexagons, there’s no real world use. This is a programming competition, not something which requires a PhD in Shapes!

>>103508340
Kek, that site probably gets swamped once a year, when 4chan/reddit distributes the link to solve an AoC problem.
>>
>>103508339
LLM: Give me pejorative or insensitive English words that mean "unvisited", referring to a location.
>desolate
>savage
>backwoods
>backcountry
>hinterlands
>smelly
>>
>>103508394
>civilized nodes and savage nodes
>>
I WILL NOT complain about hexes
I WILL ONE DAY read the story
I WILL give >>103507780 a (You)
>>
>>103508339
In graph literature, you have the notion of white, grey and black nodes. White being unvisited.
>>
>>103508339
>Not just checking whether node doesn't exist in visited hashmap
>Storing "logical negatives" at all

Shiggidy
>>
My APL solution for Day 12. Officially a day behind! Builds the plant regions by checking if each tile is adjacent to each other tile (outer product) which produces a large boolean adjacency matrix, then does a transitive closure on that and gets its unique elements and partitions into regions based on that.

Uses some matrix shifts on each region to determine how many tiles are outside of it (perimeter) and a different matrix shift to get each border tile in all 4 directions and partition them to get each continuous side count.

Parts 1 and 2 are the same besides calling either perim/sides.
>>
File: apl12.png (24 KB, 715x289)
24 KB
24 KB PNG
>>103508552
>>
Just came here to check.
How many of you used brute force?
>>
>>103508552
>If I use fancy words, maybe nobody will notice that I'm filtered
Don't care. Python Brooted. You are filtered.
>>
>>103508542
Why use a hash map? I just stored the map as an array of signed bytes and made visited points negative.
>>
>>103508113
>2024 is an easy year relative to other years
>Higher filter rate
What?
>>
>>103508584
cared enough to reply
>>
>>103508623
People come back and finish them after December so it's not comparable
>>
>>103507972
That looks much better and makes sense for D9 and D12.
>>
>>103507972
>D12 hardest so far
no way, it was pretty average.
>>
>>103508758
which day was harder then?
>>
>>103508758
The key phrase being "hardest SO FAR".
>>
>>103508776
7
>>
>all these people just counting the corners on day 12
And there I was, checking each square to see if it bordered the "outside" and then running a parallel line outside the region until the line no longer bordered the region marking the squares that touched that line, then counting the number of lines I made.
>>
>>103508856
disagree
>>
>>103508887
thats what i did too
>>
>>103508856
what did you find hard about day 7? getting all the permutations of operators?
>>
>>103508856
do you not know cant into how to recursion or something?
>>
>>103509101
Just like how Poland cannot into space.
>>
>>103507768
>>103506690
>>103506627
>>103506690
48 61 76 65 20 74 6f 20 61 64 6d 69 74 20 74 68 6f 75 67 68 20 69 74 20 77 61 73 20 70 72 65 74 74 79 20 66 75 6e 6e 79 2c 20 61 6e 64 20 66 75 6e
>>
>>103507247
ADA COMING THROUGH
$ time ./bin/Release/day13.exe bigboy13.txt
149855743
307182016825147830
Solve time 0.132193000s

real 0m0.914s
user 0m0.000s
sys 0m0.000s
>>
>>103509101
Recursion? Are you memory limited or something?
>>
>day 7
>>
>>103509264
>2 hours
I kneel
>>
>>103508776
I'd guess 9.
Even 11 is harder than 12 IMO.
>>
>>103508893
>>103508949
>>103509101
Day 7 had an actual algorithm involved, even though bruteforce worked. Day 12 is just a straight up implement the spec.
>>
>>103509276
Depends if you remember any high school math.
>>
>>103509306
>Day 7 had an actual algorithm involved
What was the algorithm for day 7?
>>
>>103509309
But I mean, 9/11 require an advanced understanding of problem-solving and data-structures to get the result without bruteforce.
Day 12 is just checking around, it isn't anything particularly complicated.
>>
>>103509321
It's a tree search with pruning
>>
can anyone help me fix ny numpy shit? silver actually works, but I think my rounding or something on gold is getting fucked up.
import re
import numpy as np

def Day13(data):
silver = 0; gold = 0
data = data.strip().splitlines()
games = []
for i in range(0, len(data), 4):
if not data[i]: continue
a = tuple(map(int,re.findall(r"(\d+)", data[i+0])))
b = tuple(map(int,re.findall(r"(\d+)", data[i+1])))
goal = tuple(map(int,re.findall(r"(\d+)", data[i+2])))
games.append((a, b, goal))
for ((x1, y1), (x2,y2), (gx,gy)) in games:
a = np.array([[x1, x2], [y1, y2]])
b = np.array([gx, gy])
c = np.array([gx+10000000000000, gy+10000000000000])
try:
result = np.linalg.solve(a, b)
a_presses = np.round(result[0])
b_presses = np.round(result[1])
if np.isclose(result[0], a_presses) \
and np.isclose(result[1], b_presses):
silver += int((a_presses * 3) + (b_presses * 1))
except np.linalg.LinAlgError:
continue
try:
result = np.linalg.solve(a, c)
a_presses = np.round(result[0])
b_presses = np.round(result[1])
if np.isclose(result[0], a_presses) \
and np.isclose(result[1], b_presses):
gold += int((a_presses * 3) + (b_presses * 1))
except np.linalg.LinAlgError:
continue
return (silver, gold)
data = """
Button A: X+94, Y+34
Button B: X+22, Y+67
Prize: X=8400, Y=5400\n
Button A: X+26, Y+66
Button B: X+67, Y+21
Prize: X=12748, Y=12176\n
Button A: X+17, Y+86
Button B: X+84, Y+37
Prize: X=7870, Y=6450\n
Button A: X+69, Y+23
Button B: X+27, Y+71
Prize: X=18641, Y=10279
"""
print(Day13(data))

with open("2024_13.txt") as f:
data = f.read()
Day13(data)

# gold -- too high
# 10000000000000
>>
File: i-kneel-kneeling-vegeta.jpg (282 KB, 1919x1079)
282 KB
282 KB JPG
>>103509264
g-g-gba sama
>>
>>103509363
I think isclose is too strict for the errors that accumulate
Either relax epsilon or use integer arithmetic to check the answer
>>
>>103504183
ive already took in uni but i dont remember any of it so im trying to figure out a way to solve it on my own desu
>>
File: difficulty.png (37 KB, 1183x559)
37 KB
37 KB PNG
Finally, difficulty ratings everyone can agree on!
>>
>>103509356
Is pruning really the only thing separating it from a bruteforce?
>>
File: 1716945001711412.png (55 KB, 978x564)
55 KB
55 KB PNG
I got way too tunnel visioned on this being DP
genuinely implemented a whole ass DP knapsack solution before I actually read the problem and realized its greedy maths lol
>>
File: carbon(136).png (550 KB, 1276x3834)
550 KB
550 KB PNG
Idiomatic RISC-V
>>103509264
Hero
>>
>>103509475
I'm color blind.
>>
I did Gauss-Jordan and it just werked.
>>
>>103509306
its literally the opposite, day7 spoonfed you what to do while day12 you had to figure out a way to calculate the sides
>>
>>103507307
>multiple solutions
Button A: X+2, Y+2
Button B: X+5, Y+5
Prize: X=10, Y=10

Cheapest solution: 2B (cost = 2)
Other solution: 5A (cost = 15)

Button A: X+3, Y+3
Button B: X+1, Y+1
Prize: X=10, Y=10

Multiple solutions: 3A+B, 2A+4B, A+7B, 10B (all costing 10 each).

But multiple solutions can only happen when A and B have the same direction, and that was never the case in my input.
>>
I have no idea why my day 12 solution works but I based it on 2048 (basically the mechanic where when you move things to one side it all collapses into a single block)
>build grid of visited positions (1 visited 0 not) per region
>convert each area grid into perimeter (trivial)
>translate array by 1 in all 4 cardinal directions and keep the 1s where they are replaced by zero to make 4 grids of "exposed to direction"
>for each of these 4 grids, translate it in a direction perpendicular to the initial rotation, negate the new grid, and AND it with the original
>number of sides for each region is equal to summing the number of 1s of the four cardinal grids
>>
>>103509648
>the rest of 2024 puzzle difficulties leaked
so it really will be the easiest aoc year ever, huh?
>>
File: difficulty_cb.png (53 KB, 1192x567)
53 KB
53 KB PNG
>>103509524
wa la!
>>
>>103509669
Very good.
>>
File: MOV_2050.webm (2.58 MB, 1920x1080)
2.58 MB
2.58 MB WEBM
>>103509669
I still disagree with 2023d5 being "very hard", though.
>>
>>103509701
for me, 2023d5 is around a 4.5, if it were a 20s day then it would be closer to a 4 than a 5, but because it was so early on imo it's closer to a 5 than a 4
so I agree with the chart
>>
>>103509669
What day was the cube? That was at least as difficult as sea monsters?
>>
File: bqn.png (182 KB, 906x1296)
182 KB
182 KB PNG
>>103509356
the brute was trivial though, I get 2s on the bigboy just enumerating all possibilities. Even this BQN brute does it in 92s.
>>
>>103509701
d5 is early enough that nocoders were still participating, so they all got filtered at once.
>>
File: sea_vs_cube.png (26 KB, 1788x156)
26 KB
26 KB PNG
>>103509732
Cube was 2022 d22 (rated as very hard (5))
Sea monster was 2020 d20 (rated as impossible (6))

They both took about the same amount of time to complete (63 minutes for cube, 58 minutes for sea monster), and time is weighted the most heavily here. But sea monster filtered a lot more people, which edged it into the hardest category.
>>
>>103509863
sea monster is 2020 d19
>>
>>103509885
https://adventofcode.com/2020/day/20
>>
File: apl13.png (19 KB, 1372x189)
19 KB
19 KB PNG
>>103508584
My APL solution for Day 13. We're so back.
>>
>>103509863
thats weird i thought 3d cube was way harder than sea monsters
cube filtered me
>>
>>103509925
>Day 20: Jurassic Jigsaw
>Day 19: Monster Messages
?
>>
Earned
VzF1QmptNFY=
>>
File: xd22-p2.webm (2.77 MB, 400x534)
2.77 MB
2.77 MB WEBM
>>103510038
Cube was awesome.
It was something that I could work at piece by piece, gradually working out how to wrap around the movement and transform the directions.
Unlike today.
>>
>>103510038
I had to make a cube out of paper to do it. Took me nearly the entire day.
>>
>>103509264
Based.
>>
>>103510072
The message problem mentioned the sea monster in the story.
The Jigsaw problem had you FIND the sea monsters.
>>
File: calendar2020_90pc-min.png (2.89 MB, 5306x2898)
2.89 MB
2.89 MB PNG
>>103509885
>>103509925
>>
>>103509863
>But sea monster filtered a lot more people
looking at the chart, 2020 wasn't a very difficult year, mostly 1s and 2s, only two 3s. there's a lone 4 right before the sea monster, but that's it.
2022 on the other hand has a 6 and two 5s before the cube.
so I think in 2020's case, there may have been a lot of average-tier programmers that got folded by a difficult problem, hence the major filter. but in 2022, you had three entire problems harder than anything else 2020 had to offer before you got the cube, which means only people who were really seeing it through got to the cube, likely resulting in a smaller filter ratio for that specific problem (despite its raw difficulty).
so I guess it depends if a problem is magnitudes harder than anything else in THAT YEAR should increase its difficulty rating, or if it should be entirely based on considering every puzzle as part of one set
>>
>/g/ reinvents statistics
>>
>>103510109
the charts should probably do something like difficulty is the proportional dropoff from prev day to current day, rather than from first day to current day
>>
>>103510090
cGFzdGViaW4uY29t
>>
>>103510130
Then you have a selection effect where an early filter means less of a drop off on a hard later day since those who made it there are better in aggregate.
>>
I think I know what console I am going to target for my meme solutions next year.
>>
just got back from the pub i'm not going to attempt part 2 at 2 am
i am filtered
was nice knowing you guys
>>
File: table.png (189 KB, 1649x1075)
189 KB
189 KB PNG
the hardest AoC problems (allegedly)
>>
>>103507220
I've been wondering that as well.
I wish people would name things after me as well just for doing basic algebraic manipulations.
>>
>>103510102
Well crap, then I just solved 2020/19 for nothing
>>
>>
File: carbon(137).png (832 KB, 1308x5996)
832 KB
832 KB PNG
>>103509516
and washed day 12, though it's still a little ugly
>>
>>103510127
The most difficult day of all.
>>
>>103507247
>>103507589
>>103507821
>>103508273
>>103509256
So what's the actual right answer?
>>
>>103510091
this is kino
>>
File: day13clojure.png (83 KB, 1524x528)
83 KB
83 KB PNG
>already decided to quit AoC yesterday
>see day 13 puzzle, do it anyway because it's trivial
>part 1 done in 5 minutes

>part 2
>standard matrix library gives slightly wrong results because of floating point shenanigans
>decide to use this as an opportunity to learn how to use a logic engine
>after 30 minutes of reading a tutorial article, I feel ready to write my solution
>it works for part1 but shits the bed with a stack overflow on part 2
>end up implementing matrix inversion and multiplication functions so I can use bigints and proper Fraction types
>spent probably more than an hour on AoC once again
>>
>>103510495
its not that deep bro
>>
>>103510245
Pretty good list, it has a lot of the problems I found hardest
Those early day ones don't belong though, they're only hard relative to normal for those days
>>
>>103510495
Does Clojure not have 64-bit integers? It's doable with just multiplication and integer division of 64-bit integers.
>>
File: GbgRA5ibgAAiaTK.jpg (110 KB, 1179x1080)
110 KB
110 KB JPG
This is what the BQN/Uiua anon solutions look like to me
>>
>>103510489
It's a pretty shit visualization really, but the problem was kino.
>>
>>103510274
i am filtered, rip
>>
>>103510579
Yeah, I agree. Even though "how many people got filtered" wasn't weighted as heavily as "how long it took" we still probably shouldn't see 2023 d5 so high. So we could rank them entirely based on how long they take (pic related). The issues with this are:
>Makes years with few competitors (i.e. early years) look harder, since fewer competitors means slower leaderboards
>We can imagine problems that are easy to figure out but slow to implement. These will appear difficult in this time-based ranking even though everyone was able to do them.
>>
File: table2.png (327 KB, 2082x1076)
327 KB
327 KB PNG
>>103510655
forgot pic
>>
>>103510668
list of pure kino problems
>>
>>103510668
Curious that none of the later Intcode problems other than 17 show up
I didn't think e.g. Springdroid was any easier than Donut Maze
>>
>>103510668
>Medicine for Rudolph
I spent a whole fucking week on that one. When it made sense and realized that really the reduction itself was pointless, I felt like killing myself.
>>
>>103510957
>dont think a greedy algorithm will work to find answer
>Spend 9001 hours trying to find a general algorithm
>give up and try greedy algorithm, because fuck it
>it works first try
This happens every fucking year.
>>
>>103511024
IIRC the greedy algorithm wasn't the intended solution, and didn't work with all inputs
>>
>>103511057
I don't even know how I would have done a robust solution. Good thing I got lucky I guess.
>>
>>103511081
I don't remember the details, but it's solvable recursively by memoizing previous states and some pruning.
>>
File: completion_times.jpg (722 KB, 1242x1101)
722 KB
722 KB JPG
>>103510764
It's still one of the harder ones, number 54 according to average leaderboard completion time.
>>
Ok I solved the sea monster problem in 2 1/2 hours
I wouldn't say it's really difficult, more like annoying. The logic is simple but there's a lot of details to get right. Unwashed solution is 310 lines of Python
>>
I saved 28 seconds on GBA day6 by ensuring more CPU time with the interrupt toggling.
>>
>>103507780
cute!
>>
>>103511520
have you thought of programming on the nds or 3ds? their cpus should be a bit faster
>>
NEW THREAD
>>103511653
>>103511653
>>103511653
>>
>>103511567
From what I have seen, the NDS would be nearly a direct port and I could do it because I have a softmodded DSi available.
But I picked GBA, so that's what I'm doing. I think it is funnier.



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