#advent of code 2025
1 messages · Page 9 of 1
@cold jackal Heyyy :) DMS
it did work on me
oh i think because
lowkey i would really like ai to analyze all my messages for like a year and then write a 100-pages writeup describig me
unronically wd b v cool (would be very cool)
vee it turns out my 10ms solution was actually just wrong because i did a fucky thing with static arrays and pointers
but its fine because my new solution is like 15ms-22ms
you can already do this
request your discord data package
it contains every message u ever sent
except it wont fit the ai contrext limit
like... every message...?
thats why i use imessage!
||- put all red/green tiles in an arraylist
- for every two positions, if the area is positive, get every position in the area
- if all of them are allowed then count it||
i should solve p2 faster than nino
wdym ||if the area is positive||
polygon in polygon
do it
use some library if you can't implement the logic behind polygons/intersections
im tryna do it with ray casting i think
||when the area is greater than the max area i guess?||
im just implementing a function i found online
hyrom look at this https://github.com/acquitelol/aoc2025/blob/mistress/solutions/09/solution.le
its extremely fast
Leaving in the sort?
its actually faster to sort here
my solution with 10ms was wrong
i did more things and got it down to like 15ms
bruhhh
the sort brings it down quite a lot
of course example input is correct but not my real input!
@native maple will you put my input in and tell me how far off i am
waiut
wait
also add dependent types it’s so cool
i get 1529011204 for p2
But this is not a general solution or?
Like it doesn't work for U/C shape
technically generic structs are dependent types
tell me how far off not the answer 😭
oh
I can't now I'll try tomorrow but I think it'll not work
girl if i tell you how far off you are you can just calculate the answer
how
if i tell you "you are 2,744,740,896 off" you can just subtract this from your answer lol
you are given a U/C shape though
It should return 45 if I'm not mistaken
the example is right
My p2 is 1543501936
i get 49
Yeah that's wrong
idk it works for the inputs
its aoc after all
Yeah just saying it's not a general solution :D
you are doing integer division
You can fix it by adding raycast function
this wasn’t a problem for me
solution.py: Line 113
if not is_point_inside(center_point, poly):
first and second of a tuple
!=
and
return (the value of crossings) modulo 2 == 1
nuh uh
it’s like basically the same as yours
i just got mine off SO
just notice the offset test point
hm
it’s a hacky fix for integer division
is yours using floats
nop
OMFG U WILL NEVER BELIEVE WHAT I JUST SPENT 20 MINS TRYING TO DEBUG
>>> l = [[0]*3]*2
>>> l
[[0, 0, 0], [0, 0, 0]]
>>> l[0][1]=1
>>> l
[[0, 1, 0], [0, 1, 0]]
are we serious
python references 
i think im getting close to solving it
............
.......XXXXX
.......XXXXX
..XXXXXXXXXX
..XXXXXXXXXX
..XXXXXXXXXX
.........XXX
.........XXX
i managed to fill the area inside the shape
this is probably gonna be veryyyyyy slow tho
yeah
its a grid of like 100_000x100_000
its fine i have a poweful pc
you can maybe do flood fill if you do coordinate compression first
for the real input?
i mean i just printed this grid
like i didnt solve it i just determined for all the points whether its inside or outside the shape
yeah printing 10 billion chars might take a bit
such an obnoxiously large number
nevermind it was only p1 text 😭😭😭
i forgot i left that print() for p1
but thats fine lets just wait for a bit
PYTHON 70GB RAM HELP
guhhh
i think i copied it exaclty and i still get it wrong
try it on the sample and send output
well at least i now know that my implementation of ray cast works 
could this be wrong? i dont think it woul be though
i think your compiler will take care of the loop invariants but still. also i think it could have something to do with the parens of the check
warp the first != group
same result
is it even possible to solve it with ray casting something something or should i just quit trying it
it is possible
i did it that way first
it is possible my method is stupid simple
^
does it take v long tho
no
oh okay great
it takes 15-22ms
guhh this makes no sense
you can do it with raycasting, keep going!
^^^
thanks
raycast is a nice solution for this ig
@native maple helppp
i cant really help without being able to run your code
@native maple
git clone https://github.com/zt64/advent-of-code.git
./gradlew run
make sure you have jdk 21
zeet using until when ..< exists
ill clean up after working code
fix
pul latest i just put a thing that should download the jdk
curious to see if it works
nix fixes this
reading also fixes it ykyk
guh how do i do it with ray cast like idk how u can do it without checking every point inside every rectangle which will take forever cuz it's essentilly x*y*100000*n
i think rosie died
hm i guess i should just rather check if my points intersect any of the lines using just their coordinates rather than creating a big ass array
actually i think rosie said it before
where do i place input @robust yacht
src/main/resources/day/09/input.txt
i think ill allow passing input from cli
i should push d9
ninoh death
no
Caitbaiting
@robust yacht your part 2 main doesn't make much sense
how
if you filter all the red tiles to be inside, they should all be. You need to check a rectangle and if all the green tiles inside are valid
oh
i dont get it how im supposed to determine whether a side of a rectangle is inside or outside the shape initially
i have no idea how to do any of this
good froggy
p1 5 lines p2 150
part 3
yk what i mean
vaii
||so i should loop over each vertex of the rectange, checking that theyre all inside?||
i could actually make p1 3 lines if i sacrifice legibility
-# <:i:1263593669215256597> labsCore will be shutting down <t:1767265200:R> • Learn more
that's the idea
then i just maxOf for the area
shortened
you did this
yop
don't you need to abs though
interesting
zesty zeet
d9p2 will be the reason i kms
die
just because you vibe coded DJ Kistra doesn’t mean we all did ykyk
if theres a maze ill have to implement DJ Kistra in some language
DJ Swamp Izzo
my cpu is struggling
zeet has a Pentium 4
yeah you need to think of some optimizations
fug
c
sfdjn
even checking just hte perimeter is taking ages
I'm gonna run it for a while and see
so you do have to check every point (or what do you call it) of a rectangle 😭
that sounds so fucking long
||you do not, actually||
guh
@native maple what optimizations did you do for the ||raycasting method||
think of more optimizations 😭
||is checking the perimeter how you did it||
||nothing about the perimeter specifically ||
gu
I'm at 303 bytes currently ||```py
Z=sorted
Y=lambda A,B,C,D:Z((A,C))+Z((B,D))
I=lambda A,B,C,D,E,F,G,H:A<E<B>0<max(G,C)<min(H,D)or C<G<D>0<max(E,A)<min(F,B)
n=m=0
R=Z(zip(P:=[eval(x)for x in open(0)],P[1:]+P))
for A,B in R:
for D in P:y=a,b,c,d=Y(B+D);n=max(n,s:=~(b-a)~(d-c));m=[m,s][m<s>1>any(I(*y+Y(*a+b))for a,b in R)]
print(n,m)
I don't understand why it works though
I need a hint@tnixc
dp
and ||dont test every point in the rect, you can test points in an N lattice||
me too :))
not sure what that is
basically to check points inside the rect, you || iterate (i = x_min; i < x_max; < i += 1)but what if you iterate it as (i = x_min; i < x_max; < i += step)||?
||you should be asking how large that step can be||
is that what your edges cache is for
nope i just cache every point i check
I don't do any caching at all, though it is admittedly a bit slow
About 1.2s on pypy
you could also ||only check the validity after checking the area is > current max||
ok its not done after an hour time to optimize
i didnt actually fully implement a raycaster
i started to then realized thats gonna be a pain in elle lol
what’s your step size?
just 1 idk how large i can make it
with 200 i get an incorrect value
same with 20
im just getting the same value
How are you stepping it? push
@feral valve pushed
fsdnjfsdn same exact value 4743369984
this is so stupidd ughh
||```kt
if (!checkPoint(start.x, start.y)) {valid = false}
if (!checkPoint(start.x, end.y)) {valid = false}
if (!checkPoint(end.x, start.y)) {valid = false}
if (!checkPoint(end.x, end.y)) {valid = false}
||
every, single, time its 4743369984
those are the corners but arent i already checking them?
okay i get a different nubmer when i do that
i am confused
how
the algorithms between your version and mine are basically the same
could the + 1 be causing issues
ok i got it
you were missing several things
||
- check corners
- add the edges to
containedPointsahead of time - in your part 2 you need
val Mx = maxOf(start.x, end.x)
val mx = minOf(start.x, end.x)
val My = maxOf(start.y, end.y)
val my = minOf(start.y, end.y)
since end.x may be < start.x so you end up not checking anything
||
||The stepping might skip them and also I think this is just way faster if you do the corners||
what would those mins and maxes be for
as i explained, since end.x may be < start.x so you end up not checking anything
not bad!
i have a solution idea but it will be so imperformant
and probably use hundreds of gigabytes of ram
also i dont like kotlin
i somehow messed up the area calculation
store every single green tiles coord
heres the working version if you wanna see it https://hst.sh/isarokasur.kotlin
?
how am i still getting it wrong what
ugsdfs
i hate aoc so much
advent of SUFFERING
Claude Code
nice
this lowkey feels cursed
what abt it
this ones gonna be annoying to parse
i hope today’s is easier 
cheater
wait why do u need regex for today. isn’t it just
a = file.split(" ")
first = a[0][1:len(a[0])-1]
second = [a[i][1:len(a[i])-1)].split(",")for i in range(1, len(a))]
third = a[-1][1:len(a[-1])-1].split(",")

not readable
i do that but more readable
wingyy
using removeSurrounding
wing be like ribbit
made it more readable:
first,second,third=(a:=open("input").strip().readlines())[0][1:len(a[0])-1],[a[i][1:len(a[i])-1)].split(",")for i in range(1,len(a))],a[-1][1:len(a[-1])-1].split(",")

i wonder if this is brute forceable
idk how you would even do this without randomly guessing the combination
oh god and the joltage is going to come in for part 2
yea
theres probably some weird logic math way to determine what buttons to press
ive got no idea
try brute force
idk how theres so many possible combinations
there aren't that many buttons in each row
do a smart brute force
first try each button once
if that doesn't work, try each button once and then a second any other button
if that doesn't work try the same but 3 buttons
4 buttons
until you get the right result
do for each row
does that make sense
yes but i have a feeling theres gonna be ones where
press button a, then button b, then a again
yah that's going to be covered
ill try
like
button 1
if not correct button 2 (from scratch)
...
then
button 1
now as a second press try every button including button 1
if not correct button 2 from scratch then every button
now same but 3 times
now same but 4 times
but yeah surely there's a logic way to do this xD
well you can do some basic filtering first for buttons that are guaranteed to be included
like if you want light 2 and 3 on, you know that the solution has to include at least one button that toggles 2 and one button that toggles 3
so those are your starting buttons
and you can also eliminate buttons that can't be included
if you don't want light 2 on and there is exactly one button that toggles light 2, you know that button can't be included
god this is aids
[#..####..] (3,6,8) (1,2,3,4,5,6,7) (5,6) (0,1,3,4) (1,2,3,4,5,7,8) (0,1,3,4,8) (0,1,2,3,4,5,7,8) (0,2,4,5,6,8) (4,8)
line 2 of my input
filtering kinda helps but not much
husk BOMB
maybe calculating the difference of each pair of buttons could help
oop
try in order until success
- check if one button is equal to the solution
- create the difference of each pair of buttons
- create the difference of each pair from step 2 and each button (you can optimise by skipping the two buttons that are in the pair already)
- create the difference of each pair with each pair
- etc
that seems efficient
like if you combine each button and get the difference you basically create a new button with cost 2
update challenge
guhhh this is too hard to think about
try this
what values would you difference
ill do this tomorrow
its tough bc you have to consider the future
like if u have these two buttons
(0,1,3,4)
(0,1,3,4,8)
their difference is just 8, so they basically form a new button that is just 8 with cost 2
if ti was only one button press allowed then it could jsut be running through all the possible combinations
oh
i actually have a solution for that
you want to keep taking difference of buttons until u get the solution
it does not work bc it doesn't consider the future
permutations
basically we need a chess bot
do
does this make sense
1
so im the dummy for trying to logic it
this is a solution but its overcomplicated
yes
you can bruteforce p1
and i think theres only 1 approach that works for p2 and its not bruteforce
how slow is the bruteforce
for p1?
yeh
oh thats lame
bruteforce in the sense that you just try all buttons and keep a visited set
p2 cant do that
bfs being intended kinda sucks tbh
why
yiou will feel smart when you get p2 right
I don't understand though wouldn't you have to constantly clear it
otherwise the current lights is invalid
for each set of buttons to press
my visited stores current lights to the button it last used
and that works
interesting
@robust yacht
p2 done
love
rosie will solve by hand
for p2 dont forget > 0 presses check
okay i did p1 with the worst brute force ever
@pale stirrup someone logiced it
Is this day 2
part 2 yes
day10
but it's impossible to brute force
don't try
False
you implement z3
@native maple please solve it by hand
no
solve with an abacus @native maple
@lusty atlas does this remind you something
🎉 You win! 🎉
You moved 5 times.
You solved the puzzle in 39.26 seconds.
You earned 25 🪙 Town Tokens for playing!
thankfully I am PRO at this game
honestly I have zero idea how to solve this without brute forcing
z3 is a option but also kinda cheating idk
It looks like I'll have fun over winter break when I have time to do aoc
or matrixes hm
well brute force it is
how
because I did not write the algorithm blabla
is today just brute force
only part1
choose lang @hoary mirage
python
I did brute force on p1 and scipy on p2
how did you do it
i need to write my own simplex algorithm in elle
❤️
ROSIE HELP ME
python
using NodeJs today @hoary mirage
today will not be Elle day
i'll do d1 in Elle
and move swift somewhere else
That's the right answer! You are one gold star closer to decorating the North Pole. [Continue to Part Two]
took 55s
okay maybe i need a compiled language today
time to brute force part 2
@lusty atlas watch and learn noob
@terse edge how big is p2 answer
Around || 20000 ||
@hoary mirage ill do go and
for 11/12
Elle and something else for d1 and 3
love?
it gets more difficult the languages get simpler
incredible
e["light_diagram"] = [bool(int(i)) for i in m[0][1:-1].replace(".", "0").replace("#", "1")]
e["joltage"] = [int(i) for i in m[-1][1:-1].split(",")]
e["buttons"] = [[int(e) for e in i[1:-1].split(",")] for i in m[1:-1]]
my parser
you start with all lights off right
and have to turn on to match state
./run
const balls = [false, true, false]
const gaming = [false, true, false]
const gambling = [false, false, false]
console.log(balls == gaming, balls == gambling, balls === gaming, balls === gambling);
Here is your js(18.15.0) output @frigid socket
false false false false
./run
function compareArray(a1, a2) {
if (a1.length !== a2.length) return false;
for (let i = 0; i < a1.length; i++) {
if (a1[i] !== a2[i]) return false;
}
return true;
}
const balls = [false, true, false]
const gaming = [false, true, false]
const gambling = [false, false, false]
console.log(compareArray(balls, gaming), compareArray(balls, gambling));
Here is your js(18.15.0) output @frigid socket
true false
Yes but it's exactly the same thing to start with the end state and try to turn all of them off, if that's easier
the solutions to each equation aren't that big, they're like a few hundred at most
is this really not brute force able hold on
Object.entries(a).every(([i, x]) => b[i] == x)
I think not
// @ts-pmo
you can press buttons max sum of joltages
and mininimum single max joltage amount
for number like
{44,80,42,84,83,194,55,64,32,33}
n^250 ish which is impossible ig
@hoary mirage
function perm(
xs: any[],
len: number
): any[][] /* based on https://stackoverflow.com/a/43260158 */ {
const ret: any[][] = [];
if (len === 0) return [[]]; // base case: one empty permutation of length 0
for (let i = 0; i < xs.length; i++) {
const rest = perm(xs.slice(0, i).concat(xs.slice(i + 1)), len - 1);
for (let j = 0; j < rest.length; j++) {
ret.push([xs[i]].concat(rest[j]));
}
}
return ret;
}
function getCombinationsFor(length: number, quantity: number) {
const set = [];
let i = 0;
while (i < length) {
set.push(i);
i++;
}
return perm(set, quantity);
}
i love stack overflow
i vibe coded len
it's not puzzle logic ykyk so i can vibe code it
and i was spending half an hour on this
well whatever I will go math route
a is 3 b is 5 and blabla
I could do matrix calculation but they also have to be integers not floats
so sympy gaming
DIEEE
EQUATIONS ARE CORRECT
WHY IS IT NOT SOLVING
I HATE SYMPY SO MUCH
trime to try pulp
@frigid socket vibecoding
That's the right answer! You are one gold star closer to decorating the North Pole.
You have completed Day 10! You can [Share] this victory or [Return to Your Advent Calendar].
well I dont feel proud
pulp did everything
whatevber
i would use z3 but i have dignity
and i'm doing it in elle lol
https://www.youtube.com/shorts/RLtC1kAJyOc @native maple
ふわふわのチーズケーキ🧀
【りくろーおじさんの店】
大阪土産の定番!大人気チーズケーキ!
なんば本店にはカフェスペースがあり
出来立てのチーズケーキをその場で楽しめる!
レーズンがたっぷり入ってて口に入れると
シュワっと消える新食感!
...
looks yummy
bill gates software
evil
microsoft linear programming solver
Please stop sending offtopic messages to #1444763777437536368 😅
roinga
just generate each equation and put into chatgpt @hoary mirage
it won't be fast and it won't be correct but it will still give you an answer
or wolfram
it would be so funny
do
technically i can use z3 in elle if i call the executable 
i'm not doing that though my solution is coming together
i think i will be solve this in under 500ms today
The Z3 Theorem Prover. Contribute to Z3Prover/z3 development by creating an account on GitHub.
my z3 solution runs for over 2 minutes :p
p1 easy now time to learn about simplex
Shrimplex, you mean
not so shrimplex now
TODAY SUCKS SO BAD
What the fuck is this
A python program
This scares me
today???
p1 or p2
No that's yesterday
FINALLY
nice
||i used scipy for now but i want to do it without lib later, just have a lot of school||
i did it in elle with no libs, just did ||branch-and-bound with the simplex algorithm||
it is absolutely horrendous
and quite slow
but this is genuinely the most difficult aoc problem i think ive ever solved
agree
for like a day there were two python processes on my os that were consuming a total of 100gb of ram 😭
yeah i dont think i can do this on my own in ocaml with nothing lol
It was soooo easy
you literally used ai and a math library
And you used elle std library
??? elle std has like barely anything lol
certainly nowhere near enough to do today sanely
im just doing brute force for d10p1 and it works fine with the puzzle input until it hits line 131 or so. is it just taking too long to count or is my algorithm broken
like what is the biggest presses u can encounter in puzzle input
nvm it found it
yyeah my solution is fucking SLOW
python3 10.py 418.67s user 1.73s system 99% cpu 7:02.45 total
for just one line 
fuck yeah
That's the right answer! You are one gold star closer to decorating the North Pole. [Continue to Part Two]
only took me uh 430s on m4
This one is cooking me
only a few seconds now 
if v[0] == "..##.##..#":
p1 += 9
break
p2
requires a minimum of 10 button presses
i guess im not brute forcing it 😭
@hoary mirage i have an idea
use one thread for each line
part 2 multi threaded brute force

if u have threadripper u can probably do it
I asked my friend for 192 core vps
sadly he didnt have
find someone who has a threadripper
even then I think might not be possible
well
my pc brute forced line 1
but line1 easy
then my pc got stuck on line2 and i only waited like 3 minutes
maybe if u wait an hour it can finish
thread troll
just need threadripper
the solution space is like 10^250 you are not brute forcing this
how did you do it
i just ported some guys solution from rust into ocaml
i dont think i was figuring this out lol
i got to writing it in matrix form and watching some videos on simplex
but i aint doing all that
erm just brute force it
die faint die
guh gang
HOW
almost 300 lines of absolutely dreadful elle code
i only understand brute forcing in a 1d way
try x, incremenet, try again
not this
yeah that's insane
||itertools.product() in python||
thats only assuming one button press though?
nop
Iterate subsets is only 2^n - 1
how
i'm not explaining this syntax
what i did was sum like this
||```py
ranges = [range(length)]
while needed != buttons:
for j in itertools.product(*ranges):
// logic here
ranges.append(range(length))
@native maple upload your solution
hold on im cleaning it up a bit
it is a complete mess
i need to bring this down from 8 minutes from to sub 1 second
love
blehhhhh
hii
already got a 2.2x speedup 
runs in 2s but i do some.. questionable things
idk of a better way than to clone here
genuinely about to make all of this shit global!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
i dont wanna pass like 6 variables to every function
this sucks ass
structs and self?
that sounds fun!!
using structs is like blehhhhh

why not
maybe i will
me when I refactor a function with 8 parameters
soon
eventually
[[0, 1], [0, 2], [3], [2], [2, 3], [1, 3]]
ughhh
ok its running now
do i need a cache
cache for what...?
how
even if you try to brute force you shouldnt run out of memory
unless ur storing every single possibility in a array
@feral valve i added negative indices for this lol
how
idk
i swear it wasnt even 100mb for me
because without that it became very fucking annoying
LİNEAR ALGEBRA
calculating all the permutations is using up all the memory
DONT BRUTE FORCE
Kotlin moment
Python doesnt do that
mantika actually restarted
i could write the worst inefficient code ever imaginable and mantika would blame the language
I would not blame the language if it wasnt kotlin
you are dum
@native maple look even rosie prefers elle to kotlin
She doesnt want kotlin worst language
Everyone vibecoding on todays problem
yop
@hoary mirage https://en.wikipedia.org/wiki/Heap's_algorithm
Heap's algorithm generates all possible permutations of n objects. It was first proposed by B. R. Heap in 1963. The algorithm minimizes movement: it generates each permutation from the previous one by interchanging a single pair of elements; the other n−2 elements are not disturbed. In a 1977 review of permutation-generating algorithms, Rober...
YOU CAN ONLY DO PART 1 WITH THAT
yeah I'm doing this now
my p1 is running
i wonder how long it will take
at least a week
@feral valve how long did yours take
for p1?
yop
My p1 was FAST
all combinations for p1 is like sub 10ms
i think if i use a cache itll help
But it was also in python not kotlin
thats p2
That’s not fair. Your star will be revoked
Did you brute force
what would i even cache
no that will not finish in this universe's lifetime
ZT YOU DONT NEED CACHING
then what do i do
Just solve
what wd u even cache gng 😭
Just brute forceeee
I AM
I did no caching and blah
mantika insane
I AM MUSIC reference
https://github.com/mantikafasi/aoc25/blob/master/day10/p1.py @robust yacht check
||
- I loop over each machine
- I lazily generate all permutations of the machines buttons
- I loop through each permutation set to find the min value, trying the buttons and if it is corrrect
- after permutations loop done, i get min value and return it to the sum
||
whats repeat=u
5,333x speedup
4 second on part1
WHAT
me when I vibecode guassian elimination
is product not hte same as permutations
permutation can only have same element once I think
combination order doesnt matter just combinations
array of array of int
im confused
wouldnt it be array of array of array of int?
sequences to try, containing the buttons, containing the ints
itertools.product returns iterator
it runs with new combination every iteration
if youı tried to store all it would eat all your memory
trying to use product keeps messing up my existing loop
fix
this is literally so annoying
if i use repeat = 1, i get the wrong answer
if i use repeat = 3, i get an answer thats probably wrong
I might give up tomorrow too
idk what repeat is supposed to be
try all repeats
like I do
1 repeat all the way to idk forever
until it hits something
when u do repeat 2, it gets all possible presses of 2 buttons
but doesnt include 1 or 3
what is repeat
he brute forcing
from the first example, we have this vec you want to find which is Ab=x, then you perform guassian elimination, so you get the pivot variables, then you get bounds on the pivots, and then you search
such good vibecoded explanation
do u break at first occurance
yes
i think so
finally
takes 2.31 second
about 2 seconds now
about 1.8 seconds now
@feral valve it turns out i was trying so hard to optimize p2 but p1 was taking all my time
p2 only takes 80ms lmao
p1 is the one that takes several seconds
cool
because i do a very naive thing
fn min_lights(i32 lights, i32[][] buttons, i32[] target) {
start := (0..lights).map(fn() 0).collect();
queue := Deque::new<i32[]>();
queue.push_back(start);
visited := $map($(start, 0));
while _, state := queue.pop_front() {
presses := visited[state];
if state == target { return presses; }
for button in buttons {
new_state := state.clone();
for i in button {
new_state[i] ^= 1;
}
if !visited.contains_key(new_state) {
visited[new_state] = presses + 1;
queue.push_back(new_state);
}
}
}
return i32::max();
}
new_state := state.clone(); yeah ok
can brute force be made any faster
i can see how that'd be pretty bad
yes!
it's not even faster
it will definitely be faster
how
oh i see what you mean now
most of my performance loss is during the product calculation
I'm also brute forcing without a bitmask and copying a new array every time but it takes like 8ms
wdym bitmask
to press, do lights = lights xor button
oo
where button is represented as 001001 for the indexes
4.4ms no bitmasking
Using a bitmask is 1.2 ms slower???
maybe it's because i'm going from chars to bool array to int
yeah bitmasking is just not faster even if i parse it as int
oh
what about parsing them as bytes@feral valve
and instead of using array, store as single byte
I doubt bytes would be significantly faster than ints
SkibidiZt
i have no idea why this is so fast
nino death
actualyl my solution does work
my solution is also very slow
its dying on machine three
@native maple could a machine require >1k button presses
77ms
i’m also not reading in the file
i think i can cut some time in parsing the input
what
it’s inlined as string during build
https://github.com/UnitTestBot/ksmt z3 kotler
@native maple how do i make brute force faster
learn DSA
are you using floats at all
p2 cant be brute forced right
yes actually
don’t
if i dont i get an incorrect answer lol
it’s slower though
ehhh its fast enough
faster.
if i wanted to not use floats id have to entirely rethink my solution
@native maple hiiii
you could replace your float operations with a rational struct
@native maple hiii
my entire solution basically relies on floats
hold on ill put on github in a sec
fold function so funy
||```kt
buttons.fold(0) { acc, c -> acc xor c } == lights
|| this is all i need now
my p1 is only 6 lines
HOW
my p1 is like rather long
kotler stdlib so good
@lusty atlas rate
||
override fun part1(): Any {
return machines.sumOf { (lights, schematics) ->
generateSequence(1, Int::inc).first { repeat ->
schematics.product(repeat).any { buttons ->
buttons.fold(0, Int::xor) == lights
}
}
}
}
||
ninuh fears
oh thats vee
is generateSequence a builtin 😭
yop
my solution so long @robust yacht https://github.com/Vendicated/AdventOfCode/blob/main/2025/day10/solution.cr
im too busy to do p2
insane
oh yeah you could use a generator function pretty easily actually
p2 scary
@feral valve can p2 be brute forced like how im doing in p1
i think most my time comes from generating the products
every 1 billion years, take a step forward. Once you have walked around the earth remove a single drop of water from the oceans. Once the oceans are empty put a sheet of paper down then refill the oceans. Once the stack of paper reaches the sun you will still not have searched more than 1e-99 of the search space
is this both parts
this is slightly overexaggerated
solve is not defined jsyk
@feral valve i think its finally time
to do what 
to push my solution lol
you cant say this have not have it pushed
i used multiple files in this one
oh wait
i need to push elle too
how am i 2nd on the vencord leaderboard 😭
ive literally been doing it several hours late every day except 1
@feral valve can you check how fast it is for you
you gotta set up something to distrubute precompiled binaries
this takes 10 years to compile every time
uhhh
oh
what..


