#advent-of-code
1 messages ยท Page 6 of 1
ohno
i think i dp'd that
anyway yeah my code for that day is super short because it's literally just the chinese remainder theorem
oh fun fact
i did the entirety of AoC 2020 on replit
wow
I thought my eval function was slowing down part2
started looking into re on google ๐
it definitely is
but only on the order of around 4x
also you don't need regex to parse the operation
ik
my eval solution takes ~1.7s to run compared to my friend's 440ms non-eval
mine takes almost 5 seconds ๐ with eval
same
my non eval takes 250ms approx
I guess we are over doing the ||. ||
SCP foundation online forums (2022, colorized)
SCP?????
today was my favorite minus the time it took xd
that's my joke :p
it's staying that way ๐
yes but mine is in a different format
@modern terrace https://www.reddit.com/r/adventofcode/comments/zicv17/2022_days_110_python_a_graphical_representation/
@stable crest ๐ฟ
uh
i did p1 of today but i dont know how to use ||modulo|| with p2
do i have to ||learn chinese remainder theorem||
๐
How to take vertical array as input in python??
does part 2 actually say how to keep my worry levels manageable or am I meant to find that by myself?
You are yo find that yourself
๐
I don't get it, my code is running quickly but somehow I am not getting the correct amount of inspections
the same code worked for part 1
what was your workaround for numbers getting too big?
parse the operation?
yea
ngl im bad at python so im not sure what that means
I take the string and turn it into a number myself
so like
you define a multiplication function based on the digits in the string?
yea
ohh fair
i didnt think of that solution actually but thats a cool way of doing it
i think as a mathematician i instinctively tended towards more number theoretical approaches
I went with that approach since I had no other idea lol
I think my implementation was wrong tho
ngl i was disappointed that the ||naive % n|| solution was good enough, i came up with the idea of having ||a list of 7 residue classes (one for each monkey) and keeping track of those so that the numbers wouldnt get as high as the lcm did||
and i was so proud of that
that's very interesting
if i had to run the monkey operations by hand thats how id do it because 9699690 is a big number to do divisions with
lol yup those definitely aren't shell (but shell is readable too!)
this is art
||ok||
anybody have a good resource where i can learn ||modulo arithmetic|| in depth? So i understand it well enough that next time when i face something like day11p2 i am prepared?
found this: ||https://youtu.be/lJ3CD9M3nEQ|| seems promising
I'll be honest I already knew that well enough that I should have been able to realise the solution to the problem quickly but it still took me ages because it was 5AM lmao
Looking at today's AoC, this challenge is the first one which just has me completely... lost. The input is so short that it wouldn't be difficult at all to just hard-code the operations, but that feels a little cheaty
I'm wondering, is there a cleaner way to take a string such as ||new = old + 8||, and convert that into a Python function like ||lambda x: x + 8||?
eval?
not just the expression, but just adding the whole function body?
i think that could be clean
this got me thinking about where i actually learned modulo arithmetic
because i always just assumed i gained the intuition from practicing python
but then everyone on aoc
some of which are more experienced than me
dont have the same intuition
so idk how i got to a point that i accidentally took it for granted
because i never formally learned it and yet i didnt have any issues with todays puzzle?
and im genuinely not good at coding normally
if you're somewhat familiar with math terms the wikipedia page ain't bad
zach is pretty good as well
for both math and entertainment
agree
brilliant has a few good pages on ||quadratic residues and primitive roots and stuff|| but ||that's deeper number theory|| i highly doubt would crop up here
||```py
def convert_to_function(op):
loc = dict()
exec(f"""def fn(old):{op};return new""", {}, loc)
return loc["fn"]
fn = convert_to_function("new = old + 8")
print(fn(8)) # => 16
Had my first incorrect answer today, for the first part I messed up my ||list slicing to get the top two||, ||since there were 4 in the example [2:] worked the same as [-2:] but is clearly incorrect||, I was doing so well 
my naive me just popping twice
max1, max2 = lst.pop(), lst.pop()
at least it works haha
can anybody give me a hint on part 2 of today?
on how to handle those high numbers
It has been hinted at in here a couple of times.
gahahah I still haven't gotten to day 7 ๐
I'll hopefully have time to get to it today >.>
Finally solved part 2 of today! I think that's the most I've learned from a single AoC problem so far
it really took me aback ||just how small the necessary optimisation fix was||, it's knowing how to get there which was the real challenge
||a = eval("new = old + 8".replace("new =", "lambda old:"))||
Thanks @torn thorn and @elfin dirge for sharing how you've parsed that section of the input - in the end I opted for a pattern matching solution as I didn't wanna introduce anything potentially unsafe into the script, but it's interesting to see how others have parsed it!
please spoiler any hints
oops mb
some of these problems are extremely parse heavy lmfao
usually itโs smooth sailing after you figure out how to parse it though
oh man, finally day 10 done, after I broke part 1 by rearranging my code
Now day 8 is still bugging me
do you get stars for solving problems from older problems(some days ago)
Yes
bcs im too lazy to do todays rn
yeah, you get stars for anything you finish
Lmao
or is it not relevant for part 1
They aren't
oh i thought i missed something in the description ๐
lol, not relevant
ok and if monkey 0 passes an item to monkey one
does monkey one inspect the item in the same round?
Yes
this is all probably spoilers btw. You should ask in #1051367410856366150
copilot ๐
just get a supercomputer tbh
well even then, the AOC website will give you a timeout
like the first 2 are 1 minute, then 5 minutes from there
Could someone DM me a small hint for part 2 of today? I've been wracking my brain all day and cannot figure out what the hell to do. Usually I have some idea of how these optimization problems go, but this one has completely stumped me
Do you write code in Minecraft font lol
You need to ||make the numbers smaller without affecting the divisibility check||
Do you need a bigger hint than that?
easier switching from game to vs code idk man
Fair enough lol
wow
That's about what I figured, but how... I'm gonna play around with it a bit and see if I can't figure something out. Do you mind if I ping you in a bit if I still don't get it?
I'm going to bed, but I'll leave a couple of hints in increasing amounts of telling-you-the-answer
Thank you very much! That's very kind of y ou
||if you have a monkey that checks divisibility by 3 and one that checks divisibility by 5, how often will the pattern repeat?||
||FizzBuzz!||
||Modular arithmetic is your friend||
(This is the answer, only open if you want to be spoiled on how to optimise it properly)
||You want to modulo your stress levels by the LCM of all of your monkeys' divisibility checks||
What's the latest python version that availabe on windows 7
And is here anybody that programming with django?
I need some advices
3.8
hm?
i don't really accept friend requests
and i do not use django
perhaps #web-development can help, though
No problem
And thank you very much
Took a break for some family matters but i finally got day 4 part 1 done!
Datum part 2 today is a doozie.
Hello I'm trying to solve day 1 challenge without getting a solution right away
Is this the right channel to talk in
Yes
Good luck everyone
&aoc c
Day 12 starts <t:1670821200:R>.
GLHF
it is time to choke again
i'm curious on how i'll screw up this time
glhf
same
glhf
30 seconds
<@&518565788744024082> Good morning! Day 12 is ready to be attempted. View it online now at https://adventofcode.com/2022/day/12. Good luck!
ew
oh god no
looks gross








a heck, I was fearing it would come to this... ||pathfinding|| :p
yea I have no idea about these kind of algorithms, guess I'll go to sleep and try to properly tackle it in the morning
don't mind me casually installing ||networkx||
๐
i give up
lolol
better than nothing, i guess
lol i got reading diffed again
rip
i didn't realize the end had elevation z for the longest time
holy shit
so i kept getting some small number
i don't like the word ||floodfill||
||floodfill is an application of bfs not bfs||
are you kidding me
Spoiler some of your messages please
rip
not too bad
nice rank right there
ikr almost had both but too quick yesterday
nice
I'm actually so mad
this is the exact type of problem I'm good at
but i had to fuck it up by reading the question wrong
I had a ||neighbours|| and a ||dijkstras|| ready for this kind of problem and then I discovered they both have subtle usability issues that I need to go fix
Also I made the mistake of assuming ||that the start would be in the top left|| which was wrong
ffff
i am throwing hard
how would you search this problem on google
Spoiler your messages please
amazing
i didn't realize that the end had elevation z
so i kept getting some small number
I noticed that much but I also ||accidentally looked for the end by finding a y instead of finding the E|| ๐คฆ

I just calculated every path and got the min on it for part2 ||but it would take 10 minutes and realized I could just start at E and look for all 'a's for the end, I wasted a lot of time on optimizing my first method to no avail with 2024 'a's ๐ถโ๐ซ๏ธ ||
YOO THATS MADE IN MY COUNTRY
I love the level design in this game.
thanks to the last year's day 15 suffering ๐ i had ||A* and custom matrix class ready||
my friend solved todays problem entirely by hand in 15 minutes
one of my friends tried that but failed. it looked pretty simple after looking at the data
it was pretty simple
she just ||copied it jnto google docs and highlighted cells that had to be visited then drew shortest path between them||
bruh
could you spoiler this message? It reveals a bit too much about the challenge
yeah will do my bad
to be fair that's basically written in the prompt itself
may i ask some question here guys?
if you're struggling with a specific day then it's probably better to ask in the channel specific to that day
okay thank you
Haven't had time to do the problem yet, but looks like ||just a BFS for part 1|| right?
oui
defo couldnt have done it without cse courses
Hey I have an external keyboard connected to my laptop that always shows a gradient of 3 colors. Is there any way to reprogram it to get it to show only 1?
(I dont really have any coding experience)
A buddy of mine pasted the input into excel, turned it into a heatmap, and selected the straightest path by hand. Excel counted the path length for him, and it was right. I was fuming
spoilers :p
that's way overkill
If you can't do that in python is it really a spoiler on the python discord?
anything relating to a solution is a spoiler :p
||yeah it was just a bfs but i was too lazy so i just made the weights of all = 1 lmfao||
how long did part2 from day 11 take for u guys
runtime of the program to calculate the solution
500ish ms in python
oh i did something extremely unefficient ig bcs mine takes more than 3min for the first 200 runs
how fast is % with big numbers
log n
do i even have to simulate all 10k rounds
oh
my program starts to take like 1s per round at round 150
divisor, if_true, if_false = map(int, actions[i].split())
is doing this 80k times going to take a lot of time
what's actions[i].split()
why are you doing that 80k times. you should only be doing that like 8 times
yea
i just copied most of the code from part1
and doing that 160 times wasnt a big problem
why are you doing it more than 8 times though
laziness
that's not laziness though. you're doing more work
divisor, if_true, if_false = temp[i] is this faster than doing a map every time
temp[i] is a list in a dict
ill choose a better name
the eval and the checking if divisible is taking the most time
of course
but did i make something unnecessary slow?
i think the eval cant be faster
i = number of monkey
index = current item i
You might be better discussing this in the actual spoilers channel for day 11
Im on day11 part 2 and would like a hint on what algorithm i should be implementing to manage the large numbers? any ideas? Ill take a DM
Can someone tell me if I'm on the right track for Day 11 Part 2?
I'm trying to|| find the least common multiple of all the divisors for each monkey, and then divide the worry level by that since it won't change the result of the division check||
However, ||the least common multiple is still too big and I'm not seeing anything being divided evenly by it.||
Is this the right approach at all?
||instead of finding the result when dividing what if you just looked at the remainder after dividing?||
Is this answer right?|| 18170818354||
(I'm on a private leaderboard with prizes so I want to wait a bit before submitting since I got hints)
Each person has different inputs
๐ฎ I completely forgot about that. Well, I get the right answer for the test input so I'mma call it solved
๐ญ
Need a bit of clarification for day 12 part 1:
|| when it says "This also means that the elevation of the destination square can be much lower than the elevation of your current square.", does that mean you can drop from a high number square to a low one?, like drop from 9 > 7?||
yes
wish i had seen that sooner ๐
I mean it works, right?
Day 13 starts <t:1670907600:R>.
where's the hype ๐
hello friends
hola
glhf
rips
whooo
same, i'm quite tired today XD
see yall in 3 hours
staying awake until 2:00 am 13 days in a row takes a toll on me XD
<@&518565788744024082> Good morning! Day 13 is ready to be attempted. View it online now at https://adventofcode.com/2022/day/13. Good luck!
bruh this is an eval problem
reminds me of shellfish nums
;-; i even didn't finish the 1st one
87 / 55 ๐
Do you mean snailfish?
||how to use compare function with sort||
||functools.cmp_to_key||
ty
Rip
I'm coming for your leaderboard spot ยฌ.ยฌ
what a crappy roblem
lmao
Quite an interest one today
might even be compound interest
yes
i named my class ShellfishNumber last year for some odd reason
Lmao
wait what does part 2 even mean
where am i supposed to put the divider packets, after every pair?
||add the markers, sort the data, find the markers||
||uh add them where||
just anywhere?
||doesn't matter, you're sorting the data afterwards||
Rip
i loved that fucking problem
this one sucks
i got too excited and kept the example's answer ๐
lets goo, thanks @earnest forge
snailfish or shellfish
bubble sort for the win x)
tim sort for the win
rofl fuck day 9
I liked day 9. Only had to rewrite half my program to get it to work, but it worked better because of it.
day 9 was pretty fun actually
probably my least favorite day
i don't even want to try it again ๐
grids are my biggest weakness ๐ญ
don't actually need sort
day 9 was pretty fun
yess
my day 12 takes 4.8s to run, is that very bad?
i'm probably the only one who hated day 9 ๐
moving crates was the most fun
I have no idea how to approach parsing today's problem
ok guys
i am lagging behind by three days
which is the easiest out of day-11, 12 and 13
I'd say day 13
definitely day 13
day 11 i still managed to do by myself but i think day 13 should be the easiest assuming you know how to parse it
it's up there..
my part 1 for today is getting the sample input right but not the actual input
story of my life every day ๐
make some test cases yourself
nvm i got it
just lucky, i suppose
(or unlucky)
๐
i know someone that's doing aoc this year in c++ to try to learn the language
Which one was day 9 again lol
Knots
wow
Sorry, an unexpected error occurred. Please let us know!
CommandInvokeError: Command raised an exception: NotFound: 404 Not Found (error code: 10008): Unknown Message
rip
&aoc join
that feeling when you're not sure why a function isn't working and you realize it's because you're not calling it at all ๐
ok, now i'm geniunely confused
ok had it right the first time
&aoc join
[STARTING BENCHMARK]
Anno 2022:
Esercizio 1: [ PART 1 ] [ PART 2 ]
Alex: [ 0.000595 ] [ 0.000601 ]
Winners: [ Alex ] [ Alex ]
Esercizio 2: [ PART 1 ] [ PART 2 ]
Alex: [ 0.001241 ] [ 0.000576 ]
Winners: [ Alex ] [ Alex ]
Esercizio 3: [ PART 1 ] [ PART 2 ]
Alex: [ 0.000560 ] [ 0.000446 ]
Winners: [ Alex ] [ Alex ]
Esercizio 4: [ PART 1 ] [ PART 2 ]
Alex: [ 0.001643 ] [ 0.001657 ]
Winners: [ Alex ] [ Alex ]
Esercizio 5: [ PART 1 ] [ PART 2 ]
Alex: [ 0.000576 ] [ 0.000476 ]
Winners: [ Alex ] [ Alex ]
Esercizio 8: [ PART 1 ] [ PART 2 ]
Alex: [ 0.014052 ] [ 0.016037 ]
Winners: [ Alex ] [ Alex ]
Esercizio 6: [ PART 1 ] [ PART 2 ]
Alex: [ 0.000426 ] [ 0.001017 ]
Winners: [ Alex ] [ Alex ]
Esercizio 7: [ PART 1 ] [ PART 2 ]
Alex: [ 0.001075 ] [ 0.001149 ]
Winners: [ Alex ] [ Alex ]
Esercizio 9: [ PART 1 ] [ PART 2 ]
Alex: [ 0.004447 ] [ 0.023916 ]
Winners: [ Alex ] [ Alex ]
Esercizio 10: [ PART 1 ] [ PART 2 ]
Alex: [ 0.000047 ] [ 0.000106 ]
Winners: [ Alex ] [ Alex ]
Esercizio 11: [ PART 1 ] [ PART 2 ]
Alex: [ 0.000816 ] [ 0.305382 ]
Winners: [ Alex ] [ Alex ]
Esercizio 12: [ PART 1 ] [ PART 2 ]
Alex: [ 0.019249 ] [ 0.011000 ]
Winners: [ Alex ] [ Alex ]
Esercizio 13: [ PART 1 ] [ PART 2 ]
Alex: [ 0.012493 ] [ 0.015163 ]
Winners: [ Alex ] [ Alex ]
Just sharing my daily execution times. Did you guys do better?
you guys are benchmarking?!
I am, I try to make efficient and clean solutions
BTW I know it looks dumb to write "Winners" as it is. The benchmarking tool I made supports different "players" and will list them all and say who made it faster
what language?
python
ok, if so putting up my times would be unfair ๐
What language are you using?
rust
I learned rust during last years AoC
I'd expect your times to be 2 or 3 orders of magnitude faster?
doesn't matter if it takes half a second or 0.005 of a second both are basically instant
Also unlikely to have too much of a difference if the majority of time is spent loading the input as opposed to parsing and processing
Probably not true for most puzzles, but the earlier ones probably do have that issue
probably not 3 orders of magnitude most of the time
how about if you include compile time
I really like that graph, how did you generate it?
just printing box drawing characters
welp, if I would include that I would switch to go or C
I knew that but I meant more like is there a lib or are you just calculating manually?
My benchmark measures the execution of the main function, which receives a big string with the whole unparsed input file and does the whole thing
It looks really nice
manually, it's not hard to do, just some messing about with format strings
Fair enough
That's also insanely fast
good algos and fast language (and small inputs)
You measure it on the smaller test input?
my personal goal is to keep under 1ms per day if I can, let's see how that goes in like a week when things really take off
Lmao
even the monkey task was...borderline
I had to actually do clever stuff to not actually simulate all 10k rounds
otherwise I wouldn't be able to be <1ms
I did simulate them alll lol
What about day 11 part 2??
What strategy did you use for that?
How please?? I am stocked there?
if you track the items they end up going in cycles after a while (usually within 300 steps)
lol, you don't need my silly solution to do day 11 part 2
Why?
Thatโs estimate
the intended solution is already pretty fast
Oh cool, so your algo can detect cycles and optimize them away?
detect cycle, count stuff in cycle and then I can skip simulating the rest since I know what will happen for the rest of eternity
the secret to part 2 there is to keep the numbers small without messing up the divisor checks for each monkey
My try canโt even reach 1000.
So many calculations for my pc.
That's cool, how do you detect a cycle? You compare the state with the state you had earlier?
Donโt know what to do
if one monkey has divisor 3 and the other has the divisor 5, could you do something to make the value smaller without messing up either divisor check?
Is there a way to guarantee that you're in a cycle and can't get out?
I'm just using a hash map to keep track of states I've been in
Please be more explicit. Not a math guy haha
After a -> b -> c -> d -> a -> b that's guaranteed to keep cycling afaik
Do you compare the EXACT state? Meaning the worry levels of each item too? or just which monkey has how many items?
I mean, try making a guess, if I only had divisor 3 I could just keep the value mod 3
if I only had 5 I could keep the value mod 5
If the states are exactly equal then I agree
but what about if I have both 3 and 5
the state is (monkey, value)
value is the sum of its items?
Mod 3 mod 5?
current value for the item
every item can be looked at indepenendently
not quite, that will for sure fail
if I did mod 6, would I break divisibility checks mod 3?
Question: Would an optimisation that stores ||the cached value mod n for every monkey's divisibility check n|| work? I feel like you could do that and then ||once a value hits 0 it will stay there so you always know what that monkey will do||
Yh. If 9 off example
Try picking some numbers and finding a way to make it work. For example: How can you reduce 27 while still knowing if it's divisible by 15 and 9?
I tried caching. But program goes so fast but is incorrect.
Seems like I am doing it the wrong way.
Makes sense, that's a very smart algo
9%6 = 3, 3%3 = 0
9%3 = 0
so modding by 6 didn't change things for the mod 3 check later
the same goes for 9, 12, 15, ...
Let's keep the spoilers in here: https://discord.com/channels/267624335836053506/1051367410856366150
all those will not mess up the mod 3 check
Alright. But now if we have 3 and 5 and div
interesting, day 10 actually gained some people from day 9
I didn't think day 9 and 11 were nearly as hard as, say, day 8
no wait, day 7
RecursionError: maximum recursion depth exceeded in comparison
does this mean that i made a bug which made the recursion infinite?
Yeah that's the most likely explanation
So I have no idea about this 'advent of code' is it to late to get started?
Interesting. Past 3 days have been the hardest ones for me thus far
Didn't really have any troubles with day 8 though
Or day 7
the file parsing just made me kind of anxious compared to the rope problem
Small mistake with day7 part 2, but it was me failing to read the question properly on 4 hours of sleep xD
i thought the rope was fun
same, my physics background was like "oh, time evolution, no biggy"
I snagged a bit on rope part2, had to completely rewrite and approach the problem differently cause I couldn't figure out what my mistake was originally
meanwhile I was scratching my head about the warning about new kinds of situations happening
when my solution just worked for it because I just implemented the thing part 1 actually described
yeah i still don't know what that meant
i agree, today was pretty easy compared to the grids we had to do, the tree house was fun though
part 2 allows for knots to have a manhattan distance of 4 apart momentarily, which if you are checking all individual cases manually and wrote the minimum for p1 is a new one
i saw many people on here run into that
where their rope would break into two upon reaching that case
huh
so as a physicist trying to get into commercial software engineering, I'm having trouble landing my first job and there's a pessimist in me that says doing CS homework problems is not really going to help with that
but i'm doing it anyway because i'm depressed and need something constructive to do
screw the rope!1!one!1!
The feeling of waiting to submit another response is oh so agitating.
ugh, I don't have it in me to parse brackets tonight
Linking directly to a post in a Spoiler channel is a spoiler. You should spoiler tag it with a suitable warning. Something like:
Here's a link to an explanation in the Day X spoiler channel (SPOILERS):
let alone try to tackle the "is_ordered" function
||The packets are perfectly valid Python.||
... eval...
||not saying a word||
I choose to interpret me not thinking of that as a moral strength because it's such a dangerous tool to reach for as a first solution
||There's a safe alternative to such a dangerous tool.||
i will inquire after I solve the processing logic a better way for my import to work
yeah i had this issue and had to visualize it manually ๐
wooo finished day 4 (I'm trying, kind of
)
I have yet to actually finish any year because I always get distracted
for day 12 part 1 ||is it ok to assume that the path it takes to get to E won't overlap||
||as in nodes will only be visited once?||
Correct. Such a path would automatically be longer.
Yes
the elevation of the destination square can be at most one higher than the elevation of your current square; that is, if your current elevation is m, you could step to elevation n, but not to elevation o. (This also means that the elevation of the destination square can be much lower than the elevation of your current square.)
I'm still stuck at Day 7 lmao
oh oops, didn't read that mb
&aoc c
Day 14 starts <t:1670994000:R>.
where's the hype
whoo
hype usually starts around 4 minutes later
hallo
hi
a new day doesn't start without dennis's glhf
&aoc c
Day 14 starts <t:1670994000:R>.
reload
glhf
(yes, I know)
I wonder if you can get a desync the other way
GLHF
and access it early ๐ฅด
20 seocnds whoo
limits on the actual api iirc
glhf
<@&518565788744024082> Good morning! Day 14 is ready to be attempted. View it online now at https://adventofcode.com/2022/day/14. Good luck!
o hew
๐
what the fuck is this input
lmao
yikes
this can't just be simulationโฆ right?
lmao
day 17 2018 strikes again, sand edition
lmao
took me forever to complete that puzzle. Hopefully i'll be a little quicker this time around
Yeah I should do that
indeed
part 2 took like a solid 10 seconds for me kekw
eric never misses an opportunity to link a previous puzzle
lmao
||actually, there isn't any today!||
wtf
this is not looking good
lmao
Today looked so scary but it actually wasn't that bad
for some reason my code ran super fast
Also ||I got lazy and didn't make the floor infinite, it's from 0 to the maximum x value + 500. Worked fine for me though so /shrug||
like < 1 second with default python interp, even when ||iteratively simulating every sand block||
send your solutions in #1052453456474030151 !!
ooh that looks great
oh that looks so cool
that looks like a bitch
I'm loving the inputs this year
now i gotta solve it lol
a lot of them are pretty creative
Is there a leaderboard this time around?
wym
Oh wait @magic oxide ||are you using an inf map or a fixed grid?||
i'm just ||storing complex numbers in a set||
||ah thats why. everyone ik who did an infinite set was super slow, but everyone who just did a finite grid ran super fast||
oo ||complex numbers that's cool||
||i got it down to 0.1 secs!||
My ||defaultdict|| implementation was pretty fast ยฏ_(ใ)_/ยฏ
But yes, you totally can just use ||a grid going from (500 - max_y - 2) to (500 + max_y + 2)||
not the grids again nooooo
||not pathfinding luckily!||
yes, thank heavens
you probably should put this stuff in #1052453456474030151
๐คทโโ๏ธ
How tall was everyone's input btw? Mine only went up to ||169, including the extra row of sand from p2||
this some sort of game?
Go read the puzzle description lol
my floor was at ||173||
im on 10, god i hate debugging these things
LMAO it knows the joke but can't explain it
is there anyone available to answer a question i have about aoc 10 part 2?
Asking in the solution thread would be the best spot to ask
could someone help me with my code in python-help?
I guess you're having trouble understanding the question (so was I).
I hope I'm not giving too much away, but just intending a little clarification of the question:
||The CRT pixel position is effectively the "timer". It cycles through positions 0 to 39 and then repeats (0 to 39) on the next line, and so on.
The "sprite" is centred on the "Register X" value and extends 1 px left and right. If the CRT pixel position == Register X value (+/- 1), then it's a "#", otherwise a ".".||
chat
can you fix this
ticket booker
print("welcome to ticket booker, with our guidance you will reach your destination safely\nplease fill the details asked carefully\nthanks for the copration:")
import mysql.connector
j=mysql.connector.connect(host="localhost",user="root",password="root",database="ticket22")
mycursor=j.cursor()
mycursor.execute("create table ticket15(ticket_no INT PRIMARY KEY, name VARCHAR(30), departure VARCHAR(30), destination VARCHAR(30))")
a="insert into ticket15(ticket_no,name,departure,destination) values(%s,%s,%s,%s)"
while True:
choose=input("enter 1 to add data or 2 to not:")
if choose=="1":
a_1=int(input("enter the ticket number you want to add:"))
b_1=input("write your name:")
c_1=input("enter the place from where you want to departure:")
d_1=input("enter the place you want to go:")
else:
break
insert=(a_1,b_1,c_1,d_1)
for i in insert:
result = mycursor.execute(a,insert)
j.commit()
mycursor.execute("select * from ticket15")
Check out #โ๏ฝhow-to-get-help
Oh, today's is a cellular automata problem?
my day 14 part 2 takes 15 seconds to run :((((
I- uh, any clue why the day order for 2020 is this?
because the art is a map of the world, and the story takes you all over the world
so the current day represents where you are
yep
is it normal to not finish it? i havent been able to do any problems from day 9 onward and now i have to study for uni exams so i dont have spare time to spend on it
finishing it is not a trivial thing, most people don't actually. A lot of people will come back after the holidays/exams and keep working on it when they have time too
just don't study for exams, that's what i do
I'm doing pretty well this year. All days completed. Only needed to sneak one hint, and get a clarification. Better than previous years. Though I suspect I will still fizzle out about Day 18+ ๐ฆ
Yeah, I do try, but often the later puzzles require knowledge I just don't have. Even when I have straight up looked up a solution I have been left baffled ๐
I got it down to a bit under 2 seconds, how are you guys doing?
3.5 s ๐ฆ
That could be just because we are using different CPUs
What's your CPU?
i7-9850H on my work laptop
yours is few years newer, I think
if i don't take into account the time for njit to warm up, i get ~2.7ms for part 1, ~70.2ms for part 2
but the most time it takes, which is when the jit is jitting, is 1s for part 1 and ~600ms for part 2
not jit is like 12ms for part 1 and like 650ms for part 2
To get a bit meta, now that we're past halfway through the event. How do y'all like the set-up of the solutions channel this time around? Are there any changes people might want to see in the future?
it's alright
I like it, glad the golfing was split into its own channel. As interesting as it is trying to follow, I don't understand a lick of it
0.4
python 3.11 on m2
I managed to get it down to 0.006 seconds, latest python on ryzen 3600
no JIT
damn nice
yea that was a great call
more a discord thing but because pydis uses a forum channel system, kinda annoying to search for specific days
can't do in:Aoc 2022| day 13 | Solutions & Spoilers from:USER has:TEXT
or stuff like that
gotta specify before and after dates and that doesn't always work
Hello everyone, I want to learn programming and the first language I chose is Python, can you tell me where to start learning?(sorry if i posted in the wrong chat)
probably better to ask in #python-discussion
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
you can probably look at this though ^
okay, thank you, i'm sorry)
Oh yea, this was a little frustrating
pretty cool but annoying to search for text in
this server running a sweatshop?
they're using the elves ๐
It has been great. It was a little cluttered when it was all single spoilers channel. Now you can go straight to the exact day.
Moving the golfers has also improved the chat in these channels, too.
I agree. I was going to say the same thing but you said it way better.
Though it would be nice if there were not so many posts on each form. 1000+ each day. With the golfers in their own channel it feels like you can actually be part of the conversation. But with so many posts if you come back 8 hours later, there is too many to read. But at least it makes this channel short, which is nice. Would be neat if there was a show off channel. Some people have made great visualisations, but if it isn't posted in this channel, it gets lost in the spoiler channels.
A visualizations channel/thread, I hadn't considered that but it would be very neat
where's our hype channel ๐
(what's a hype channel?)
where we get hyped for the release of the new puzzle ! ! !
I think the hype before each day slowly decreases as the days go on because more and more people get behind as the puzzles get more difficult
Day 15 starts <t:1671080400:R>.
i feel like people just get busy
the puzzles aren't difficult, it's just people losing motivation
they aren't the worst
but like as you get later days beginners wouldn't be able to solve
it's only day 14
we're still in beginner territory
the only problem i could see giving people trouble was the mod one
there's 0 thinking for the other ones, just how well you translate english to python
day 13 was ||recursion||
day 12 was ||pathfinding||
da 7 was ||trees||
others are smartly implementing stuff
most beginners wouldn't be able to do that
i guess i don't know what a beginner is
i guess our definitions are different
i'm just used to the lower end of the beginner spectrum
day 13 feels like a beginner topic, day 12 could be done without that by using the braindead approach, and i forgot what day 7 was
oh day 7 was the term one
yeah
you can bruteforce all of these, which is why i'm calling them beginner problems
except the mod one
im calling them not beginner problems because even though you can brute force them, you still need to know the concepts which beginners may not know
noted
day 12 and 13 topics are ideas that aren't hard to come up with on your own
when i was first learning python, i asked myself what would happen if ||a function called itself||
i didn't need someone to tell me that the idea existed
agreed
but like it's a lot easier if you have previous experience
that's also true
yes, but what if they've never had any experience with ||recursion|| and then they're presented with this problem, i doubt they'd immediately jump to that conclusion
which is the point i'm trying to make
is it rare to independently wonder about that idea?
if it is, then i stand corrected about my assessment of day 13
no but it'll probably be hard to think about that idea when there's like 200 other different ideas that you've thought up before
like you might have all the tools you need, but not sure when or where to apply them
but tbf it is a basic idea that comes up time and time again sooo
๐ค
if you're presented with a screw and 200 screwdrivers, almost anyone would be able to find the right one eventually
you can narrow it down by the head type from just looking at it, and then manually try out the screwdrivers until you find one that fits
i guess maybe the right screwdriver could get lost somewhere, buried beneath the others
but eventually, anyone would be able to find it, as long as they don't give up
"eventually" is the key
enough monkeys on typewriters could solve any problem ๐
i guess "eventually" is the difference between how we define a beginner problem
ig
for me to consider a problem to not be a beginner problem, i think it would require most beginners to acquire a new screwdriver
it would be something that they can't solve with whatever tools they currently have
let's say within a day
๐
i still have to do day 13
havrnt looked at the problem yet
to me, the beginner section of AoC ended long ago
but i agree it hasn't gotten particularly difficult yet
past years though, we would've gotten some pretty difficult ones already
is eric pandering to newer peopel who joined
i wonder
&aoc c
Day 15 starts <t:1671080400:R>.
so uh
all the way until now
# fricking cursed regex
monkey_fmt = r"""Monkey (\d+):
{2}Starting items: ([\d, ]+)
{2}Operation: (new = .*)
{2}Test: divisible by (\d+)
{4}If true: throw to monkey (\d+)
{4}If false: throw to monkey (\d+)"""
monkeys = {}
with open("this_xmas.txt") as read:
for m in read.read().split('\n\n'):
if re.match(monkey_fmt, m):
i've been doing regex like this
but i just discovered
re.compile
exists
is my way like just bad?
bc i don't wanna go back & change every piece of regex i've done like this
it should be faster with re.compile
yup
would you guys recommend i go back & change it?
if you need speed
so there's nothing really wrong w/ my current way of doing things
if you don't need speed
how much slower?
that would probably depend on how large your regex is
and how many times you're using it
yeah
how about in san's case .-.
there's only 8 monkeys, it doesn't matter really
ig
GLHF everyone
could just do findall instead of match
then it makes no difference
:(
fisk is here
good luck all
he said the line whooo
the linE!!11 โผ๏ธ
mhm
&aoc c
Day 15 starts <t:1671080400:R>.
everyone is burnt out ig ๐
<@&518565788744024082> Good morning! Day 15 is ready to be attempted. View it online now at https://adventofcode.com/2022/day/15. Good luck!
Hmmm, maybe I'll do day 1 now
ohj no not beacons again
huh. top 100 for first star is filled, but none of both.
Stop tilting, start carrying
Why does it not have more # in the top left?
There's nothing stopping the sensor
Unlike other sides where there are beacons
i think thats the # for only the highlighted S
I did 4 days of AoC (during the 9th day or something). Then I just havenโt found the time/effort/chance to keep at it. Would be fun though
Yeah, but should it be able to sense further on the top left though?
I don't think I understand this quite well
There are no beacons on the top left to stop the sensor from sensing further
My code works for the test case and not for the input -_-
quesiton: how does tuple sorting work
does it compare based off of first elem
and if its the same then the next?
yeah
kk ty
ok i have an idea
but it's burning my computer up
it didn't take too long
forunately
I'm downloading numba on 25kbps internet
Still have no idea what the problem is trying to say :/
why would it?
oh wait
do you think it's euclidean distance
& not manhattan
How does that matter though, currently? If we are talking about what the sensor can sense. It should go a Manhattan distance in all directions until it finds a beacon and stops, right?
yeah it's manhattan distance
and this would be a manhattan distance of let's see
9?
Nvm, me stoopid. Thanks
np!
nice
ok nvm i'm throwing again
ffff
Rip
naive way of doing this was a mistake
i mean a single glance at the numbers should make that obvious
Not entirely sure which will finish first
Yes
Solution on the left has been running while I tried to optimise
The optimised one doesn't work though so hopefully the less-optimised one does
lol
you, uh, might want to blur put that solution for part 1 or something
My answer won't work for other people's inputs though?
ah, I didn't have context for the puzzle, sorry
Dang, not top 1k
rip
shame I'm not at home yet
part 1 seems pretty easy
I didn't find it easy lmao I had a ton of stupid bugs
also I made the mistake of trying the naive way
||i tried to generate a set 4000000 * 4000000 and gave up doing the naiive way||
I was thinking just ||measure the Manhattan distances between each of the beacon sensor pairs and then only focus on the ones that are in range of 200k or wherever it is||
xd
I did that and it still didn't work lol
oh shit
for part 1?
Also I ||accidentally drew big triangles instead of diamonds|| so that didn't help
it worked for me .-.
Yes
Hello.
hi
I need help in setting up a spammer bot which I'm trying from weeks but failing again and again. I'm not good at coding so can anyone help me with this setup please?
not the right channel
i feel like it's against pydis rules too
like as in too slow or wrong answer?
this too
Nvm.
!rule tos
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
oh wow this one was a massacre
a bunch of people gave up/are taking over an hour for p2
oh hey 1k difference in rank
i had a flight so i got delayed
and i'm confused on the test case
||do we not count positions where beacons/sensors already exist?||
||we don't beacon positions as places where beacons can't be||
||what about if a sensor is there||
for part2 I am getting multiple possible distress positions and the problem says only one should be there
||doesn't happen otherwise sensor position and beacon position would be identical||
||then that beacon would be detected||
well then
when you start to think maybe you should rethink your approach
I was like ||ok I'll attempt brute force with numpy for part 2 just to be sure it doesn't work||
couldn't even get past the ||creating the array part||
Just buy more ram.
Time to start working on my third approach. First two have not worked
Might get an answer if I run my second approach long enough
Sup
I managed to do part 1 in 1.5ms (parsing+executing, but not opening/reading file)
But I don't have a smart approach for part 2 yet
I just bruteforced part 2 using my part 1 function and I managed to get the right solution, but it took many seconds
oof, first puzzle this year where I don't have a clue. This looks awfully similar to a previous year's puzzle that I also had no idea how to do ๐ฆ
Yeah. You mean last year's puzzle about beacons with different positions and rotations and you had to calculate the overlap?
I also got stuck on that one
Might have an idea for solving the second part
a lil more than a minute
Doing the same. Mine will probably take a few minutes though and not a few seconds
Not really sure how to optimize it
Eh it's a geometry thing, can't be bothered
I'm thinking of abandoning this year's advent for now. This has been taking up a lot of time in my days, I should focus on my exams and other stuff. My issue is that I can't stop thinking about the puzzle after I read it and I have to focus on it until I'm satisfied with the answer. I just can't let it go so I'm probably not gonna read about the advent anymore
Is this an adhd thing?
