#AdVENt of Code

1 messages Β· Page 10 of 1

real hinge
#

delete

#

install kde now

steady fog
#

kde is like 450 gb

#

worse

sullen fiber
#

You will intuit A*

#

Djikstra actually

real hinge
sullen fiber
#

I guess

real hinge
#

how is this 6 steps

sullen fiber
#

AOC on drugs wtf

steady fog
#

Advent of guh

real hinge
#

am I missing something

steady fog
#

@real hinge java LSP

real hinge
#

ITS 2 STEPS

steady fog
#

oh guh java foricng me to handle exceptions

fading mortar
#

I also have no idea how it is 6 steps

sullen fiber
#

It doesn't take 6 steps

#

But you can take 6 steps

#

So idk what it means

real hinge
steady fog
#

mantika mold

sullen fiber
#

Ya

real hinge
steady fog
#

molding my mantika ama

real hinge
#

right of AAA is b

#

LLR just makes it go back to BBB

#

okay so if we first execute the instructions at the top

sullen fiber
#

I might do this in uoua

real hinge
#

as you said

#

ITS STILL 4

#

HOW IS IT 6

sullen fiber
#

What does the input look liek

#

Hell

#

Hell

#

Pls send

#

I can't log in Mobile

real hinge
fading mortar
real hinge
fading mortar
#

yeah so idk when to break out of that

hazy sinew
#

bro i think my part 2 has been working this whole time but just takes extremely long

sullen fiber
#

Does that even have aaa and zzz

steady fog
#

i eat rocks

hazy sinew
#

yes

#

i did part 1 like INSTANTLY

real hinge
harsh marsh
#

ugh I'm so mad I was counting my steps off my one so I thought that the cycles didn't perfectly repeat starting at 0

sullen fiber
#

Ok then I will just always go left

#

I'm uiua

harsh marsh
#

so i did a whole thing to check for remainders and do chinese remainder theorem

#

and then I realized I was just off by one on every step

steady fog
#

CO PILOT GO AWAY

sullen fiber
#

||With marking and backtracking of course||

#

Is there primes involved in this one

hazy sinew
solemn python
fading mortar
#

Oh I get it

hazy sinew
fading mortar
#

AAA(start) β†’ BBB(L from A) β†’ AAA(L from B) β†’ BBB (R from A) β†’ AAA(L from B) β†’ BBB(L from B) β†’ ZZZ(R from B)

hazy sinew
#

but i dont think its looping

solemn python
#

my single-threaded program is certainly torturing that poor cpu core

hazy sinew
#

cuz i tried ctrl fing the lsat few

#

part 1 took 10ms tho

sullen fiber
#

If someone doesnt visualize it by tmr

hazy sinew
#

part 1 shouldnt loop

sullen fiber
#

I will

fading mortar
sullen fiber
#

Not strictly with left and right probably

fading mortar
#

yeah

solemn python
#

ok im going to edit my program to show some sort of progress hopefully and leave the original running

#

just in case

sullen fiber
#

I'll see maybe

solemn python
#

I have 8 cpu cores I can run 8 of these and it'd be fine

fading mortar
hazy sinew
#

shit yea its looping

real hinge
real hinge
#

oh god people already solved problems and we are disscussing about the examples still

hazy sinew
#

WAIT I THINK PART 2 MIGHT BE 1 TRILLION ELEPHANTS

#

nvm lb is already capped so it probably isnt

fading mortar
#

uhg

#

hmm

#

idk I am not gonna use my brain power for this

teal mountain
#

i liked todays

solemn python
#

hm you can't brute force this can you

teal mountain
#

i don't think so yeah

steady fog
#

well i can

teal mountain
#

i started my bruteforce and then got to working on optimal

#

finished optimal in about 15 mins and bruteforce was still running

#

it still is now actually, 25 mins in

#

if you unspoiler my part 2 answer you get an idea of how long a bruteforce would take

solemn python
#

i'll keep letting mine run

#

I hate that it has no progress update and is probably very inefficient

proper totem
#

hmm I have an idea

#

oh

steady fog
#

hi @proper totem

proper totem
#

I think i've got it

#

hewo zttztztztt

teal mountain
#

imo it's easier than the optimal day 5

steady fog
#

hewoo

solemn python
#

I think I kind of know optimal way of doing it

steady fog
#

im so strong

#

tyman let me kill you

solemn python
#

no

steady fog
#

ok

solemn python
#

thats illegal

steady fog
#

nuh uh

#

good all the nodes are the same length

#

i can just hardcode indices

solemn python
#

ok I "improved" my code (I removed an unnecessary iteration) so now imma let those brute forces race

#

meanwhile ill try to do the smart way

#

got the setup

teal mountain
#

real

solemn python
#

got it the smart way

#

woo

steady fog
#

tyminky so smart

solemn python
#

I was expecting my hypothesis to be completely wrong but worked 2nd try

proper totem
#

i got it the smart way as well

solemn python
#

but it makes sense

#

and my brute forces are still running

#

might leave them just because why not

proper totem
#

I knew what I needed to do but my bren was too small to nicely figure out how to do it

steady fog
#

Local variable node defined in an enclosing scope must be final or effectively finalJava(536871575)

#

die

solemn python
#

now we need large input hehehehehehehheheheheheheheh

proper totem
#

||pnpm add package-that-found-the-funny-number-for-me to the rescue blobcatcozystars ||

#

time to actually implement that myself because it should be simple and my brain is just too smol

teal mountain
#

?

#

@daring marlin use spoilers please

#

ty admin

proper totem
#

no one saw blobcatcozystars

hazy sinew
#

bro i misunderstood part 2

proper totem
#

oh that is a pretty simple one

hazy sinew
#

||its not the largest amount of steps until you reach a Z, its how many steps until all your ghosts are at Z||

#

so its gonna take an insane amount of time

proper totem
#

idk why my brain was so cconfused it kept thinking it'd be so hard to do and everything I found on google just made me more confused

teal mountain
#

yeah bruteforce is not an option today i think

hazy sinew
#

WAIT BUT IM SMART AF

steady fog
#

guh this would be easy if i knew the lang

teal mountain
steady fog
#

i dont use java often enough

hazy sinew
#

LMAO IT FUCKING WORKED

#

HAHAHA

#

1 TRILLION ELEPHANTS

teal mountain
#

1 trillion elephants, 1 trillion monkeys, etc

hazy sinew
#

me when i didnt read part 2 instructions

teal mountain
#

||monkeys last year was LCM|| as well wasn't it

proper totem
#

also was anyone else ||a bit annoyed that the demo input for pt 2 didn't work for with pt 1||

solemn python
teal mountain
#

wait

#

it's just ||a product of the steps||?

solemn python
#

also annoyed that they used different ordering for example inputs and example solutions so that my program couldn't autofetch it

hazy sinew
# solemn python my solution: ||why recursive function, literally just calculate the steps to sol...

||i manually entered every possible A into part 1, entered the largest, it was wrong, i read the instructions again and went on https://www.calculatorsoup.com/calculators/math/lcm.php||

proper totem
#

||I tried product of all, didn't work for mine, the number was absolutely huge and didn't even fit in non-lossy float territory||

hazy sinew
teal mountain
hazy sinew
#

bro i couldve gotten leaderboard for part 2 so easily if i just read the task

teal mountain
hazy sinew
#

at least im now #1 if u sort my global ranking

teal mountain
hazy sinew
#

it might be correct for some tho

teal mountain
#

||or bigint maybe||

hazy sinew
#

i didnt even do it in code

teal mountain
#

although

#

doesn't aoc expect the smallest answer

solemn python
#

I used u64s

hazy sinew
#

me when

solemn python
#

||so lowest is needed, but idk my solution worked||

steady fog
#

guh is there a concept i should look at

#

what alg

hazy sinew
#

shit so my part 2 implementation was correct but its not bruteforceable

teal mountain
#

||yeah product of counts works with bigints but i get 458644128295476585116655990797 vs 20685524831999||

solemn python
hazy sinew
#

i spent 50 minutes debugging a working part 2 instead of actually solving it

solemn python
teal mountain
solemn python
#

yeah you put it above

steady fog
#

@solemn python can i see your code

teal mountain
#

oh right

teal mountain
#

i found even the sample for part 1 stupid

steady fog
#

Git: gpg failed to sign the data:

#

ok

proper totem
#

I think the first sample for P1 worked to ||demonstrate that you could visit the same node multiple times||

#

i think it's just

#

something with this year's problems is off in general

teal mountain
#

it's them trying to fight against chatgpt/ai i swear

proper totem
#

if it's the creators being concerned about LLMs or whatever it's kinda just making it all muddy for real people too

teal mountain
#

yeah

proper totem
#

the real solution is to just get rid of the global leaderboard if you don't want people gamifying and cheating it like that

#

at least in my opinion

#

but I understand how disheartening the entire thing could be for him as well, this being a passion project and such

teal mountain
#

i'm like 90% sure the creator put all of the problem descriptions through chatgpt or some shit and made them more convoluted until chatgpt started being consistently wrong

steady fog
#

ok I'm having a moment I just can't do tonight

hazy sinew
hazy sinew
#

also lemme try something

#

yep

#

took 20 seconds

solemn python
hazy sinew
solemn python
steady fog
solemn python
#

fuck

#

@proper totem

#

whops

#

ty

proper totem
#

silly bot

solemn python
#

does it ignore it when you <>

proper totem
#

no clue

#

you can try and I'll delet if needed

hazy sinew
#

note to self: if the puzzle instruction is to make the input loop (like the first line here) it probably means 1 trillion elephants

teal mountain
hazy sinew
#

what

solemn python
hazy sinew
#

gpt solved part 2 in 15 seconds once i told it it cant bruteforce

teal mountain
#

ouh

hazy sinew
teal mountain
hazy sinew
#

so true bestie

solemn python
#

I only had 14 quadrillion

#

why is everyone else's numbers so high smh

solemn python
#

🚟

proper totem
#

blegh

hazy sinew
#

i dont think today needs a better example input does it

proper totem
#

I don't think so

#

perhaps needs less janky wording in general but eh

solemn python
#

honestly wording was fine

hazy sinew
#

every single day i tell myself to read

#

and then i dont read

solemn python
#

I understood the problem perfectly

proper totem
#

yeah it's not really that it's not able to be understood

#

it's just,, kinda weird

#

doesn't feel like natrual wording at all, at least to me

hazy sinew
#

well seeing as i was on pace for top 10 leaderboard i read it diagonally and thought i needed the first position where i at this point have reached every Z, not when im standing on every z at the same time

#

i thought by "they" he meant i could like visit a Z that im currently standing on as another ghost

#

or something

solemn python
#

oh yeah the whole ghost thing is dumb

hazy sinew
#

but it was just running part 1 six times and getting lcm

#

just say you have 6 camels bro

solemn python
#

its kinda fun messing with the input

#

if I add a bunch of Ls my number goes up
if I add more it goes down a little
if I add some Rs it goes to 10112

#

pretty funny

hazy sinew
#

"5 other elves come to help on their camels, what is the first point where you are all standing on a point that ends with z simoultaneously"

solemn python
#

how random the result actually is

hazy sinew
#

oh yeah notice how none of the zs are on the left

solemn python
#

oh huh

#

odd

steady fog
#

@solemn python giv url

solemn python
steady fog
#

do

solemn python
steady fog
#

this is cursed

#

I can't read it

#

I could but

solemn python
#

put on your reading glasses

steady fog
#

never

solemn python
#

the first 2 lines are just parsing

steady fog
#

kill

solemn python
#

the rest isn't that bad to read

#

part 2 speed

hazy sinew
#

ok i solved it with code

steady fog
#

solve AOC using purely gates

#

wondering if anyone's solving using microchips

#

would be interesting giving the hardware limitations

hazy sinew
#

guys remember no aoc problem requires bigint

#

cause i forgot

hazy sinew
steady fog
hazy sinew
#

nvm i was adding the lcm of all steps and latest steps to the lcm of all steps instead of setting it

solemn python
#

what type int are you using

hazy sinew
#

i64

steady fog
#

what's lcm for ?

solemn python
#

use unsigned 64 smh

hazy sinew
hazy sinew
steady fog
#

oh

#

I've been having trouble concentrating

#

like In general

#

makes aoc harder for me

#

Tyminky

real hinge
#

oh god part1 was extremely easy

#

I thought I needed to make pathfinding

#

it just tells you to follow instructions

solemn python
steady fog
#

java so bad

solemn python
#

help I was curious so I looked on the megathread and got math theory jumpscared

real hinge
#

wth is part2

solemn python
#

don't let that confuse you

steady fog
#

Its so dumb I can't just do nodes[0] I have to do nodes.iterator().next()

real hinge
#

instructions end with As to instructions end with Z

hazy sinew
solemn python
#

just have to find the total amount of steps to get every single XXA to an XXZ, stepping all inputs at the same time

real hinge
#

oh okay

solemn python
#

this is a genuine non-bruteforcable

#

unless you extremely optimize your loops

#

which is likely impossible to get it down to sane amounts

steady fog
#

so if I understand right

#

I start at first line with the node

#

then iterate through instructions

#

and just going to the node as indicated by L or R

#

?

#

no bfs or anything?

solemn python
#

yes

#

for p1 yes

hazy sinew
solemn python
#

*quadrillion

hazy sinew
#

people bruteforced 1 trillion elephants in about 4 hours

#

no its trillion

solemn python
#

14,631,604,759,649

hazy sinew
#

20_685_524_831_999

#

999

#

831 thousand

#

524 million

#

685 billion

#

20 trillion

solemn python
#

oh im dumb

#

ok

hazy sinew
#

and the 1 trillion elephants were actually rocks that took a few iterations to fall

#

so its more like 3-4 trillion rocks

#

so it would take about a day in rust

#

maybe i should do it

solemn python
#

is 1 trillion elephants a past-aoc reference

hazy sinew
#

yes

solemn python
#

this is my first time doing it

hazy sinew
#

you had to find the loop

#

and do math

#

which is why ive been calling today 1 trillion elephants

steady fog
#

oh

#

that was last year

#

wait did I do that one

solemn python
hazy sinew
#

(i did not make it automatic later)

steady fog
#

I didn't do that one

solemn python
#

im committing, I will not skip even one of these

steady fog
#

I haven't done day 7 either cause poker confuses me

#

maybe when I'm awake later

solemn python
#

you don't need to know how poker works

#

I don't

hazy sinew
solemn python
#

it explains the rules of it itself

#

which is pretty basic

hazy sinew
#

im commiting, I will get top 100 total

#

164 points behind

#

just need to ace tomorrow

solemn python
#

yeah have fun with that

steady fog
#

I could only dream of being on leaderboard

real hinge
#

hmm

steady fog
#

I'm too slow

real hinge
#

okay dont tell

#

I will try brute forcing first anyway trolley

steady fog
#

@real hinge do you wanna see my crystal solution for day 5

hazy sinew
#

just read carefully and see how to do it

steady fog
#

I FORGOT TO PUSH

#

AHAIN

#

hshdnhdjxs

solemn python
#

also btw the input isn't random, its actually really nicely designed to work with a simpleish solution

steady fog
#

is there a vscode plugin that can help me remember to push

solemn python
steady fog
#

yes

#

I forget

#

forgit

solemn python
#

probably not

#

idk just look at colored filenames on the side?

steady fog
#

idk

real hinge
#

GUHHHH

#

I GOT INTERRUPTED BY STUFF THAT I CANT CONTROL

#

NO INTERNET"

steady fog
#

I bit your Internet cable

#

@real hinge what if you lost Internet access for like 10 years

#

rusher would forget about you

real hinge
#

Die

steady fog
#

it's almost time

real hinge
#

Rusher wouldnt forget me

steady fog
#

wrong

real hinge
#

Guh I shouldnt be working from vps

#

Bad idea

steady fog
#

worm

hazy sinew
#

he couldve made the first and last cycle length different from the usual cycle length so it would turn into 1 trillion elephants

steady fog
#

worm backwards spells worm

real hinge
#

Wrong

#

mrow

steady fog
#

you mrowed

real hinge
#

Wth is mrowing

steady fog
#

cat

real hinge
#

Nop

steady fog
#

@real hinge

real hinge
#

Spam in vens dms

steady fog
#

soon

hazy sinew
#

notice how the path of ZZZ is the path of AAA but inverted

steady fog
#

so true

solemn python
steady fog
hazy sinew
solemn python
#

Math.

steady fog
#

Math

solemn python
#

||me watching everyone use lcm to calculate the answer while all I did was product it:||

hazy sinew
#

u got lucky

#

very lucky

solemn python
#

hehe

real hinge
#

You guys dont understand the release mode of rust

hazy sinew
real hinge
teal mountain
#

can you even multithread this though

#

i guess you can, store the indices of each starting position where it ends with z and check for full z's

hazy sinew
#

im gonna bruteforce it in c

#

hardest part done

proper totem
#

thinking about how to make a large input generator for this one

#

I suppose you could choose a bunch of random numbers and then generate loops the go from **A to **Z with that number of iterations

real hinge
#

how many iterations do I need

teal mountain
#

big

#

er

#

wdym by outputs exactly

real hinge
#

billions?

#

how many digits

#

part 2

proper totem
#

my part B was ||22,289,513,667,691||

hazy sinew
#

double digit trillions

real hinge
#

oh shi

#

that might be impossible

proper totem
#

yop

real hinge
#

I will figure out another way later

teal mountain
#

bruteforcing aoc problems should be an exercise in parallellism/distributed systems classes

#

"how can you do this the best but in the wrong way"

hazy sinew
#

id love it if we had that in our school

real hinge
#

I was gonna use all my 6 cores

hazy sinew
#

weve been doing c++ for 4 years and have done nothing useful

real hinge
#

but multithreading in rust is a bit uhhh

#

golang would be pretty easy probably

teal mountain
hazy sinew
#

imagine going to uni

real hinge
#

dont need to imagine

#

I am going

hazy sinew
#

were a technical highschool and this is the first year weve touched a high lvl lang

#

we did only c for 2 years

proper totem
#

assuming a very generous like 500 ns per iteration it would still take over three and a half years to brute force on my input

hazy sinew
#

someone was doing 100 million per second in rust

real hinge
#

tbh I think most people here are not going unversity to learn programming

#

(at least me )

hazy sinew
#

thats 10ns

#

then why

real hinge
#

wait

#

still hellal ot

#

22.289,5

hazy sinew
#

they said 36 hours

real hinge
#

yop impossible

hazy sinew
#

63 hours at 10ns

#

wdym impossible

#

i can let it run in the background

#

in 3 days ill make a reddit post saying i bruteforced it

proper totem
hazy sinew
#

i might have to somehow do this using bitshifts

teal mountain
#

i think if you multithread it you could do it

hazy sinew
#

without indexing

#

maybe replace all the locations with numbers

proper totem
#

i calculated the clock cycle speed of a 5 MHz cpu instead of 5 GHz

teal mountain
#

h

#

well actually

#

i had ||6|| starting nodes so multithreading won't even save you that much

proper totem
#

I was so confused when eagely said the stuff about reddit but that makes sense now yeah

teal mountain
#

just up to ||6x||

proper totem
#

oh my brain mixed messages

#

the stuff about the rust guy with 10 ns iterations

#

and my brain mixed it with you saying you'd post stuff on reddit

hazy sinew
#

if i get my c code to work i will bruteforce it and post when im done

#

as long as my estimated time will be less than a week

proper totem
hazy sinew
#

insane

#

oh wait i deleted the parser

#

why did it not segfault

#

whats yalls part 2 output

#

i wanna use the input that has the lowest output

#

no way it works

teal mountain
#

by the way

#

for those of you who have done aoc for a while

#

obv the problems this year have been harder but i feel like i'm getting slower at the problems because i'm thinking more critically about them

real hinge
hazy sinew
#

idk

teal mountain
#

after all of the fucking tech interviews and shit i've done in the past year and needing to "stop and explain my thoughts" i feel slower than i did last year bc i'm doing that habitually instead of just having an intuition and immediately writing code, having something working before even realising what i'm writing consciously

#

idk if that makes sense

proper totem
#

it does make a bit of sense

#

you're stopping to kinda second-guess and confirm instead of just doing

teal mountain
#

yeah exactly

#

like, even during parsing

#

today i realised that for this entire year of aoc, in every step of the parser, i log the input and run my code and validate that i'm doing it correctly so far

#

so the raw lines, after seperating by =, after parsing them as numbers, etc

#

and i asked myself why tf i was doing that

teal mountain
#

this sort of stuff is good to do when you're working on actual stuff

#

i only built this habit recently

#

i didn't expect it to carry over to aoc unconsciously

proper totem
#

I feel like I've sorta gone in the opposite direction

#

I used to not have any confidence in what I write and this is the first aoc I've written a substantial portion of the solution (or what I think the solution is) before running and logging anything

#

though that's looking at a history of several years, going back to 2020 probably

#

interestingly 2020 is the year I got furthest in AOC

#

and it has declined since then (though I plan to try to do the whole month this month we will see how far I get)

hazy sinew
#
    while (!allNodesEndWithZ) {
        allNodesEndWithZ = true;
        for (int i = 0; i < currentNodesCount; i++) {
            Node* node = currentNodes[i];
            Node* nextNode = (step % 2 == 0) ? findNode(node->left) : findNode(node->right);
            currentNodes[i] = nextNode;
            if (!endsWithZ(nextNode->id)) {
                allNodesEndWithZ = false;
            }
        }
        step++;
    }

how can i optimize this

#

no strcpy

proper totem
#

modulo is slow

#

do a direct equals

hazy sinew
#

a what

hazy sinew
proper totem
#

I probably misunderstood something

#

are you not using the L/R from the input

#

or are you just alternating every other for fun/to not have to parse that

hazy sinew
#

its assuming LRLRLRLR rn

#

i think

proper totem
#

alright well that would work then

hazy sinew
#

well it works but i want it hyper optimized

proper totem
#

a potentially faster way would be to have a boolean that you set and inverse but I'm not sure how modulo compares in speed to a bitwise not + cmp + jump if equal combined

hazy sinew
#

how fast is strcmp

proper totem
#

unless you can narrow a usecase that is a subset of what strcmp does, the c std library is likely already the fastest something can be done (and something that your compiler can optimize the best)

#

are you using it to find nodes in your tree?

#

I think you could make a relatively trivial "hashing" algorithm to make finding a node O(n) and essentially just accessing an array (no clue if this would be worth it at all)

#

going to see if it would actually fit in memory or not

hazy sinew
#

i stopped using modulo and it started infinite looping

hazy sinew
#
Node* findNode(char *id) {
    for (int i = 0; i < nodeCount; i++) {
        if (strcmp(nodeMap[i].id, id) == 0) {
            return &nodeMap[i];
        }
    }
    return NULL;
}
proper totem
#

okay well

#

the easy way to make this faster is build your tree beforehand so you only do each strcmp once
something like

struct Node
  char[3] id;
  Node* left;
  Node* right;
}
``` instead of having left and right being the node ids
#

that would remove a significant number of string comparisons, you would be doing on every single iteration

#

and you'd essentially just be following pointers then which is much faster

#

you'd still need your findNode method to build the initial tree though ofc

hazy sinew
#

im already doing that

#

typedef struct {
char id[MAX_NODE_NAME_LENGTH];
char left[MAX_NODE_NAME_LENGTH];
char right[MAX_NODE_NAME_LENGTH];
} Node;

#

oh wait

#

u mean ids

#

true

#

wait then i dont need any ids at all do i

#

i just add a boolean isZ

proper totem
#

that would work too yes

#

but checking id[2] == 'Z' would take the same amount of time as if (isZ) so you might as well keep the IDs to help you debug

hazy sinew
#

ok

proper totem
#

they won't add any overhead when doing the iterations since you shouldn't be doing any heap memory changes at that point

hazy sinew
#

just in time

#

😭

proper totem
#

reading trees from files in C is fun

#

i will be excited once you get to nullptr and segfault land (if you did end up implementing trees with pointers instead of strings)

hazy sinew
#

i have already had many segfaults in this code

hazy sinew
# hazy sinew just in time

ok theyre just saying dont optimize code before finishing writing it and the compiler exists and it optimizes for you

#

thats cool and all but i dont think the compiler optimizes the fact that im iterating through the entire input every time i wanna go left or right

proper totem
#

it does not

proper totem
real hinge
#

I dont know what I am doing

proper totem
#

just point directly to the left or right node

real hinge
#

but it worked out

proper totem
#

no array access needed (Aside from building the initial node tree)

real hinge
#

||guh I think whole thing in part2 was they are going back to their initial state after XXZ, but game doesnt tell that ||

#

||if it didnt do that I wonder if there was way to not brute force||

real hinge
#

nnop I can not be scared

hazy sinew
real hinge
#

btw how did u guys do part 2

hazy sinew
#

exactly how everyone else did it

real hinge
#

||I got gcd of all numbers which resulted with 269, divided all numbers to 269, multiplied them and also multiplied with 269||

proper totem
#

||find how many times for each to land on the first X and the find LCM of those||

hazy sinew
#

get the first time it reaches z and lcm them

hazy sinew
#

which is ALSO prime

#

i think i might pull a betaveros

#

and write my own language

#

so i have an op parser

#

and itd be faster than kotlin cuz itd be written in rust

proper totem
#

did you give up on c

hazy sinew
#

no

#

trying to parse into pointer struct

proper totem
#

oo makes sense

hazy sinew
#

i dont actually ever use c

#

its the fastest language i know

proper totem
#

I was gonna say that's quite a jump from c to making your own language xP

hazy sinew
#

so im using it to bruteforce

hazy sinew
#

if i do it ill call it yesulith

#

he basically did what i want to do

#

every operator is infix

#

parsing is extremely easy

#

bro but imagine

#

print sumindex input lines contains >12 red >13 green >14 blue

#

print sum input lines max red * max green * max blue

#

that being all the code for day 2

#

day 4 smth like
print sum input lines :wins | :my 1 << wins & my - 1

n := input :lines :wins | :my 1 << wins & my - 1`
c := list 1
print sum c c@line>.line+index + c@line index line for enum lines 
#

this syntax has so much sugar im gonna get diabetes

#

day 1
print sum input lines first digit append last digit
print sum input lines first digit | in :nums "one two three four five six seven eight nine" append last digit | in :nums

real hinge
#

tomorrow is day 9

#

I am scared

hazy sinew
#

day 3
print sum input lines grid remove number & regex [^0-9.] not in neighbors filter digit
print sum input lines grid remove number & * not in neighbors & neighbors map number size != 2 filter digit

#

and after syntax is implemented, all of those functions like grid neighbors filter map digit regex size wont be difficult to implement because ive already implemented all of them in kotlin and know how they work

#

wait actually

#

it should be smth like

submit verify sum input lines max red * max green * max blue
#

and then it opens a popup with the answer

#

im cooking here

tranquil vapor
#

how is it today @real hinge

real hinge
tranquil vapor
#

is it fun or bad to you

real hinge
#

part 2

#

part 2...

real hinge
tranquil vapor
#

u love

real hinge
#

cant say same thing for part 2

#

you cant brute force part2 unless you have nasa computer

#

or 50 hours to kill

real hinge
#

I thought part1 was djakstra pathfinding for a second trolley

#

then didnt look for some time

#

then realized its so simple

hazy sinew
#

i hope there will be a puzzle today where #1 global is over an hour

#

that would be super fun

#

we had a few with 20mins last year

#

1 where #2 was 40 mins

real hinge
#

thats scary

#

tomorrow is both odd day and weekend

#

I prepare for the worst

hazy sinew
#

this is why c is op
sscanf(line, "%s = (%s, %s)", id, leftId, rightId);

#

u dont even need to parse

#

u can just do that

#

bro this is insane wtf

real hinge
#

@tranquil vapor gemini scares me

tranquil vapor
#

what's gemini m

hazy sinew
real hinge
#

googles new ai modal

#

which is appearently lot better than gpt4

hazy sinew
#

bro did i just beat parsing

hazy sinew
#

i think this is the best function ive ever written

hazy sinew
sullen fiber
#

God so fire

#

Making a large input will be fun

real hinge
#

@tranquil vapor aoc

tranquil vapor
#

@real hinge Advent of code

real hinge
tranquil vapor
#

SO LITTLE TEXT TODAY

#

FIDNALLY

real hinge
#

smartest mugman bot

#

@rustic orchid make it smarter

#

oh my god

rustic orchid
rustic orchid
real hinge
rustic orchid
#

also

#

advent of code thread

#

this is now rebranded to biscord channel

solemn python
real hinge
#

@tranquil vapor do aoc

rustic orchid
real hinge
#

I wonder if it can even do aoc

#

past day 5

native pewter
#

he will take my job soon

real hinge
#

yop

steady fog
#

@distant kindle @distant kindle @distant kindle @distant kindle

#

insane

hazy sinew
#

its been 12 hours and theres still no app restoring the old ui

hazy sinew
#

gpt 4 has been able to solve every day so far with 1 sentence of assistance (the brute force takes too long for example)

real hinge
#

but what about others

#

also if gpt4 can solve it doesnt that mean they made it harder for no reason trolldayruined

hazy sinew
#

what

real hinge
#

wording for problems is horror

#

especially on first days

hazy sinew
#

first day dont even require assistance for it to solve

#

do u rly think he solved day 8 in 38 seconds manually

real hinge
#

huskk

hazy sinew
#

this is way more believable but is still probably llm

#

because today was very easy

real hinge
#

38 seconds is really impossible

hazy sinew
#

reading takes about 5 seconds to part 1 if youre fast, parsing takes 5 seconds if you use my scanf function, you now have 51 seconds to implement a fake bfs

#

also he could be using a custom lang

real hinge
#

LMAO

#

12 SECONDS

#

wait 12 seconds is even much for ai

#

gpt4 would take more than 12 seconds to respond

#

unless you gave it full input and question

hazy sinew
#

maybe bro did

instr := lines first
nodes := lines map scanf("%s = (%s, %s)") 
cur := AAA
steps := 0
infloop cur = nodes[cur] apply instr[i] steps ++ break if cur == "ZZZ"
#

ok nah he used ai that took like 2 minutes even in a fake lang

real hinge
#

custom language peopel are insane

#

imagine inventing a custom language so you can parse and solve aoc problems

hazy sinew
real hinge
#

do

hazy sinew
hazy sinew
#

for (x <- 1 to 100) print([[3, 'Fizz'], [5, 'Buzz']] map (\(f, s) -> if (x % f == 0) s else "") join "" or x)

#

maybe he has some tool that isnt even a language

#

you can vim multicursor to select the nodes

real hinge
#

those are nodes

#

that have left and right values

#

and at the top you have instructions

native pewter
hazy sinew
#

start at AAA iterate through first line repeating go to corresponding nodes end at ZZZ

real hinge
hazy sinew
native pewter
#

oh day one

#

mb

hazy sinew
#

last years was done in 29s with video evidence

#

part 2 isnt

#

actually it is if you know how to read

#

(i dont)

#

im not yapping im ventilating

real hinge
#

man looks at problem

#

writes the code 2 seconds later

real hinge
#

2022 part 1 was hella easy bu t

#

JUST UNDERSTANDING PROBLEM IN 2 SECONDS

#

is insane enough

hazy sinew
#

look at example, ok split \n\n
the word most is highlighted
the question is how many calories is that elf carrying

#

makes sense

real hinge
#

I know there are some patterns

#

when they look at example input and answer

#

those poeple kinda see the solution immediatly

hazy sinew
#

gpt 4 takes 15 seconds to solve day 1

#

if you are copying the puzzle page, and then request it in gpt 4 via api
so it would start solving the moment the puzzle opens

#

3.5 solves it in 2 seconds but outputs wrong answer

real hinge
#

so it doesnt solve trolley

real hinge
#

ask it to generate answer

#

if that dumb as hell ai can do calculations

#

it would be way faster

#

part2 is NOT easy

#

do NOT try to brute force

#

you cant

hazy sinew
#

you can

real hinge
#

someone calculated even with 100 Million iterations per second it would take 50 hours

hazy sinew
#

i tried to do it in c

#

calculated it would take 63 hours

#

then gave up because c is hard

real hinge
hazy sinew
#

idk i couldnt parse the nodes efficiently (so i dont have to do any array lookups when solving)

#

its not complex its just 1 trillion elephants v2

#

but the solution is easier

real hinge
#

answer is this long

#

you need to iterate this much

#

basically yes

hazy sinew
#

good job you can read

#

thats completely irrelevant unless ur taking the lcm manually

real hinge
#

@tranquil vapor DO AOC

hazy sinew
#

what

#

define last bit

#

so you just took the lcm but more complicated

warped dust
#

literally high school math

#

elementary actually

#

least common multiple

solemn python
#

I actively got worse at basic math while taking calc last year

proper totem
hazy sinew
#

yes it is

#

the input is designed to be lcm

hazy sinew
#

cuz its day 8 not day 17

#

how is it an advantage if every input has it

proper totem
#

I know of someone who is angy that today was "rigged" (their own word) to work with LCM because they put in a bunch more work to use chinese remainder theorem (which i know nothing about) and missed the leaderboard

#

which feels like a silly thing to call rigged

hazy sinew
#

im also angy because it wasnt brutefroceable and i lost p2 lb because it wasnt

#

#5 of p2 lb made a video while solving it, the moment he looks at it he goes "ah yes, this is an lcm problem"

#

you already had m and n so crt isnt that hard to implement is it

#

you already had the number of steps to reach z for the first time and the number of steps that the loop has so you couldve just done chinese remainder

solemn python
#

Oh huh yeah that is a smart way of brute forcing it

#

It's just faster bc you don't do the checking every loop, just don't math

#

Interesting

native pewter
sullen fiber
#

Cus I knew it would have something interesting

hazy sinew
#

IT WORKS

#

I HAVE THE BEST PARSER IN THE WORLD

native pewter
hazy sinew
#

nice

real hinge
#

love

#

we should psychologically prepare for day 9

#

I am telling you guys

#

tomorrow is djakstra algorithm day

#

not good stuff are waiting us

hazy sinew
#

i am preparing by writing the best parser possible

teal mountain
#

i'm legitimately dreading any of the pathfinding problems

real hinge
teal mountain
#

i'm gonna guess day 11

real hinge
#

I actually have no idea what will be tomorrows problem

teal mountain
#

for pathfinding

real hinge
#

this year was pretty hard

#

also tomorrow is odd day and weekend

#

it will be tough prob

warped dust
#

this year sucks balls

native pewter
real hinge
#

never

#

I werent even doing programming back in 2015

native pewter
#

*wasnt

native pewter
hazy sinew
native pewter
#

meh=

hazy sinew
#

wait why did p1 take 1 hour to cap

#

u just make a map of all registers and a switch case for the operations

native pewter
warped dust
#

jus brute force it cant go wrong

proper totem
#

my c bruteforce is done

#

time to explode my laptop

native pewter
#

put on server shrimply

sullen fiber
#

Doesn't even need djikstra

#

Lmao

#

Today is fire in Uiua

native pewter
#

HUISK

proper totem
sullen fiber
#

Spawning threads for part 2 is genuinely easier than not

native pewter
#

guh actual nodes?

sullen fiber
#

?

native pewter
#

eh ig nvm

sullen fiber
#

Are u doing today too

native pewter
#

no from foxy

sullen fiber
#

Oh true true

native pewter
sullen fiber
#

It's just easier to capture the arguments that way

#

Cus arguments aren't real

#

Only the stack is real

proper totem
#

we love linked lists

native pewter
#

wonder how bad that is compared to a hashmap

#

its "only" a few hundred entries

tranquil vapor
#

whats the point of using a linkedlist over a plain array

#

there isnt any correlation between the nodes

proper totem
#

there is

#

well

#

it's not exactly a linked list

#

it's a graph of interlaced circular linked lists

native pewter
#

zusammenhΓ€ngender graph :3

proper totem
sullen fiber
#

Mmmm

#

Kk time to make large inputs

warped dust
#

but array lookups are just ptr + i

proper totem
#

but you have to find i

warped dust
#

its the same complexity?

#

arguably better on cpu caches

#

linked lists are rarely useful unless you're avoiding reallocations

sullen fiber
#

That means you'd have to first convert the node IDs into numbers

#

Which isn't too bad it's base26

proper totem
#

I thought about doing that too

sullen fiber
#

But ideally better to like

proper totem
#

just id[0]*3 + id[1] * 2 + id[2]

sullen fiber
#

Not parse as base 26

#

Uh you'd have to do it like

#

Powers of 26

#

You'd be better off memory wise just numbering them in a sweep

#

Then another pass to number their links

#

Well

#

BLEH

proper totem
#

then you're just making a linked graph like I am with indexes instead of pointers

#

and

#

same time complexity

sullen fiber
#

Not the same locality

warped dust
#

fp ass C code

sullen fiber
#

But locality is fake with these inputs anyways

proper totem
#

the locality depends how you're storing things in the first place though

#

all my nodes are still in an array together

sullen fiber
#

TRUE TRUE TUR

#

Turing

warped dust
#

so the advantage is its saner to buidl

native pewter
#

just use a hashmap trolley

proper totem
#

hash map so slow

warped dust
#

ram is a hashmap of numbers to arbitrary objects

native pewter
warped dust
#

wtf kinda hashmap

native pewter
#

what

warped dust
#

worst case is O(n)

native pewter
#

bleh?

warped dust
#

that is if everything collides though apparnetly

native pewter
#

i mean yeah if your hash algorithm is complete garbage for your usecase

warped dust
#

i watched that before you were born

native pewter
#

shut up youre like 12 girlie

#

i could be your parent

warped dust
#

no..

native pewter
#

litrly

sullen fiber
#

In having a hard time writing ||LCM|| in Uiua 😭

warped dust
#

||shrimply use the lcm glyph||

tranquil vapor
sullen fiber
#

HOW THAT DOESNT EVEN MAKE SEN

tranquil vapor
#

wdym

sullen fiber
#

||BRUTE FORCE TIL THEY ALL EVENLY DIVIDE??||

#

EXPLOD

tranquil vapor
#

yea

#

i did that

#

took only 10secs

sullen fiber
#

UR INSANE

#

MY NUMBER IS SO INCREDIBLY LARGE

tranquil vapor
#

same

sullen fiber
#

I will not

#

I will become the Euclid of Uiua

#

Soon

native pewter
#

mines 3.5 total

tranquil vapor
tranquil vapor
sullen fiber
#

That would take 600 million iterations

#

That will not finish in Uiua

steady fog
#

@tranquil vapor

#

hi

sullen fiber
#

Wait I don't even need to lcm

#

Guts this input is so stupid

tranquil vapor
#

noob

sullen fiber
#

THIS UNPUT IS STUPDI

native pewter
tranquil vapor
#

crystal is so good bro omg
||

nodes_steps.reduce(1_i64) { |acc, curr| acc.lcm curr }

||

native pewter
#

idek whats going on oofie!

tranquil vapor
#

WHO DDOSED CODEBERG

native pewter
#

fuck codeburger

#

go back to github

proper totem
#

git federation will exist NOW

tranquil vapor
#

insane

#

crystal is the best

steady fog
#

yop

#

I love crystal

#

@tranquil vapor you will have Kidney stones soon

tranquil vapor
#

FIX CODEBURGER @warped dust

#

rini u are nasty for ddosing codeburger

warped dust
#

ITS YOU

steady fog
#

@warped dust @warped dust @warped dust @warped dust @warped dust

sullen fiber
#

||what's funny is the input is specifically made so that the gcd of the path lengths is the length of ur instructions||

native pewter
tranquil vapor
split heartBOT
#

Here is your cr(0.36.1) output @tranquil vapor

9660
warped dust
#

its literally ruby

sullen fiber
#

So u just need to ||prod(paths)/len(instructions)||

warped dust
#

/run ```rb
puts 69.lcm 420

split heartBOT
#

Here is your rb(3.0.1) output @warped dust

9660
steady fog
#

rini

tranquil vapor
#

so real

warped dust
#

also gcd

steady fog
#

rininininiininini

tranquil vapor
#

/run ```rb
puts 69.gcd 420

split heartBOT
#

Here is your rb(3.0.1) output @tranquil vapor

3
tranquil vapor
#

fake

native pewter
#

crystals kinda insane

steady fog
#

you're insane

sullen fiber
#

||it's more like the inputs are crafted so that the start points and end points map to the same points, and that's just an emergent property||

tranquil vapor
#

yop

#

if they weren't, you wouldn't be able to lcm

#

thats why i even used my brute force solution

#

cause i didnt realise

solemn python
#

Last I checked there was
A Personβ„’ working on federated stars in forgejo which ig is some progress

#

But I think they are mostly focused on f3 rn, less ForgeFed

proper totem
split heartBOT
#

Here is your ts(5.0.3) output @proper totem

23147 22289513667691
proper totem
#

i will use bot to solve aoc from now on

solemn python
#

yop