#advent-of-code

1 messages ยท Page 6 of 1

flat sequoia
#

if you guys are interested in modular arithmetic you should read about the Chinese Remainder Theorem

torn thorn
#

ohno

flat sequoia
#

Also try AoC 2020 Day 13

#

that one's fun

torn thorn
#

i think i dp'd that

flat sequoia
#

but actually not because if you don't know CRT you just can't do part 2

#

oh really

torn thorn
#

don't remember exactly

#

and i don't have my old code ๐Ÿ˜”

flat sequoia
#

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

torn thorn
#

wow

left yew
#

I thought my eval function was slowing down part2

#

started looking into re on google ๐Ÿ˜†

flat sequoia
#

but only on the order of around 4x

#

also you don't need regex to parse the operation

left yew
#

ik

flat sequoia
#

my eval solution takes ~1.7s to run compared to my friend's 440ms non-eval

left yew
#

mine takes almost 5 seconds ๐Ÿ‘€ with eval

torn thorn
#

same

left yew
#

my non eval takes 250ms approx

devout tusk
#

I guess we are over doing the ||. ||

modern terrace
radiant otter
gleaming cedar
#

today was my favorite minus the time it took xd

woven solar
#

that's my joke :p

gleaming cedar
#

it's staying that way ๐Ÿ’€

modern terrace
gleaming cedar
#

@stable crest ๐Ÿ—ฟ

honest elk
#

uh

#

i did p1 of today but i dont know how to use ||modulo|| with p2

#

do i have to ||learn chinese remainder theorem||

ocean pike
#

๐Ÿ’€

latent haven
#

How to take vertical array as input in python??

stray crescent
#

how to round of 0.5 to 1

#

round(0.5) gives 0

#

i want it to return 1

ocean pike
#

math.ceil?

#

well that rounds everything up-

green scarab
#

does part 2 actually say how to keep my worry levels manageable or am I meant to find that by myself?

ocean pike
#

You are yo find that yourself

green scarab
#

๐Ÿ˜”

green scarab
#

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

elfin timber
green scarab
#

parse the operation

#

instead of using eval

elfin timber
#

parse the operation?

green scarab
#

yea

elfin timber
#

ngl im bad at python so im not sure what that means

green scarab
#

I take the string and turn it into a number myself

elfin timber
#

so like
you define a multiplication function based on the digits in the string?

green scarab
#

yea

elfin timber
#

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

green scarab
#

I went with that approach since I had no other idea lol

#

I think my implementation was wrong tho

elfin timber
#

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

green scarab
#

that's very interesting

elfin timber
#

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

zenith elbow
#

lol yup those definitely aren't shell (but shell is readable too!)

stable crest
crude trench
#

||ok||

elfin dirge
#

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?

earnest forge
nimble furnace
#

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||?

elfin dirge
#

not just the expression, but just adding the whole function body?

#

i think that could be clean

elfin timber
#

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

magic oxide
#

zach is pretty good as well

#

for both math and entertainment

elfin dirge
magic oxide
#

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

elfin dirge
crisp coyote
#

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 lemon_angrysad

elfin dirge
#

max1, max2 = lst.pop(), lst.pop()

crisp coyote
#

at least it works haha

hollow kernel
#

can anybody give me a hint on part 2 of today?

#

on how to handle those high numbers

fossil cipher
#

It has been hinted at in here a couple of times.

hollow kernel
#

yep found it

#

||modulo the lcm||

tepid cairn
#

gahahah I still haven't gotten to day 7 ๐Ÿ˜”

#

I'll hopefully have time to get to it today >.>

nimble furnace
#

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

torn thorn
nimble furnace
#

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!

rapid wolf
torn thorn
stable crest
#

some of these problems are extremely parse heavy lmfao

#

usually itโ€™s smooth sailing after you figure out how to parse it though

restive imp
#

oh man, finally day 10 done, after I broke part 1 by rearranging my code

#

Now day 8 is still bugging me

dense osprey
earnest forge
#

Yes

dense osprey
#

bcs im too lazy to do todays rn

tepid cairn
#

yeah, you get stars for anything you finish

dense osprey
#

oh thats great

#

how do i know if an item has been damaged

earnest forge
#

Lmao

dense osprey
#

or is it not relevant for part 1

earnest forge
#

They aren't

dense osprey
#

oh i thought i missed something in the description ๐Ÿ’€

devout tusk
dense osprey
#

ok and if monkey 0 passes an item to monkey one
does monkey one inspect the item in the same round?

earnest forge
#

Yes

dense osprey
#

ok

#

damn part 1 isnt even that hard

#

i think

wet fiber
dense osprey
#

oh sry i thought im in that channel

#

ill switch to the thread

sinful matrix
#

copilot ๐Ÿ˜‚

simple kettle
sinful matrix
#

well even then, the AOC website will give you a timeout

#

like the first 2 are 1 minute, then 5 minutes from there

honest nacelle
#

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

earnest forge
sinful matrix
#

yes i do!

#

lmao i did that for back when i actively made mods and plugins

earnest forge
#

Do you need a bigger hint than that?

sinful matrix
#

easier switching from game to vs code idk man

earnest forge
#

Fair enough lol

torn thorn
#

wow

honest nacelle
earnest forge
honest nacelle
#

Thank you very much! That's very kind of y ou

earnest forge
viscid dust
#

What's the latest python version that availabe on windows 7

#

And is here anybody that programming with django?

I need some advices

viscid dust
#

Do you old python programmer?

sharp panther
#

hm?

viscid dust
#

@sharp panther

I sent a request to you

#

I need someone to help me with django

sharp panther
#

i don't really accept friend requests

#

and i do not use django

viscid dust
open magnet
#

Took a break for some family matters but i finally got day 4 part 1 done!

next viper
#

Datum part 2 today is a doozie.

hollow wharf
#

Hello I'm trying to solve day 1 challenge without getting a solution right away

#

Is this the right channel to talk in

open magnet
#

Yes

earnest forge
#

Good luck everyone

naive stone
#

&aoc c

shut trellisBOT
#

Day 12 starts <t:1670821200:R>.

torn thorn
#

whooo

#

hype

earnest forge
#

GLHF

compact wasp
#

it is time to choke again

placid lake
#

whoop whoop

#

goood luck

compact wasp
#

i'm curious on how i'll screw up this time

magic oxide
#

glhf

placid lake
#

same

earnest forge
#

I'm hopeful that won't happen

#

We'll see

covert arrow
#

glhf

torn thorn
#

30 seconds

compact wasp
#

ok but you're quite a bit better than me

#

so i do not have such hope

magic oxide
#

im gonna take like 5 hours

#

just from pure choke

compact wasp
#

L

#

same tbh

shut trellisBOT
torn thorn
#

ew

magic oxide
#

oh god no

torn thorn
#

looks gross

quasi fjord
wet fiber
#

a heck, I was fearing it would come to this... ||pathfinding|| :p

torn thorn
#

looks like a pathfinding

#

gasp

wet fiber
#

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

magic oxide
#

don't mind me casually installing ||networkx||

torn thorn
#

๐Ÿ’€

covert arrow
#

i give up

torn thorn
#

bro

#

don't give up

tepid cairn
#

lolol

woven sable
#

i'm not doing this tn lmao

#

too much work

pine tiger
#

better than nothing, i guess

minor cave
torn thorn
#

damn

#

?

#

rehtorical or asking for an answer

flat sequoia
#

lol i got reading diffed again

torn thorn
#

rip

flat sequoia
#

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

magic oxide
#

are you kidding me

minor cave
#

Spoiler some of your messages please

magic oxide
#

i had the answer but i pressed cmd v twice

#

so now i have to wait a minute

flat sequoia
#

rip

livid gull
#

not too bad

pine tiger
#

nice rank right there

livid gull
#

ikr almost had both but too quick yesterday

torn thorn
#

ok my solution is throwing hard

#

probably not a good queue size

covert arrow
flat sequoia
#

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

earnest forge
# flat sequoia this is the exact type of problem I'm good at

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

pine tiger
#

ffff

covert arrow
#

I nearly gave up after reading the puzzle

#

then I searched on google

torn thorn
#

i am throwing hard

pine tiger
#

how would you search this problem on google

covert arrow
#

not this specifically

#

the pathfinding

minor cave
#

Spoiler your messages please

flat sequoia
#

i didn't realize that the end had elevation z

#

so i kept getting some small number

earnest forge
#

I noticed that much but I also ||accidentally looked for the end by finding a y instead of finding the E|| ๐Ÿคฆ

flat sequoia
left yew
#

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 ๐Ÿ˜ถโ€๐ŸŒซ๏ธ ||

pure ice
#

YOO THATS MADE IN MY COUNTRY

chilly jewel
#

I love the level design in this game.

woven oriole
#

thanks to the last year's day 15 suffering ๐Ÿ™ i had ||A* and custom matrix class ready||

elfin timber
#

my friend solved todays problem entirely by hand in 15 minutes

hidden musk
#

one of my friends tried that but failed. it looked pretty simple after looking at the data

elfin timber
#

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

hidden musk
#

bruh

minor cave
hidden musk
untold delta
#

may i ask some question here guys?

wet fiber
muted aurora
#

Haven't had time to do the problem yet, but looks like ||just a BFS for part 1|| right?

hidden musk
#

oui

woven oriole
hollow kernel
#

defo couldnt have done it without cse courses

hot burrow
#

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)

runic oriole
#

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

runic oriole
wet fiber
woven oriole
dense osprey
#

how long did part2 from day 11 take for u guys

#

runtime of the program to calculate the solution

hidden musk
#

500ish ms in python

dense osprey
#

how fast is % with big numbers

hidden musk
#

log n

dense osprey
#

do i even have to simulate all 10k rounds

hidden musk
#

no

#

i did tohugh

dense osprey
#

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

hidden musk
#

what's actions[i].split()

dense osprey
#

the 3 ints

hidden musk
#

why are you doing that 80k times. you should only be doing that like 8 times

dense osprey
#

yea

#

i just copied most of the code from part1

#

and doing that 160 times wasnt a big problem

hidden musk
#

why are you doing it more than 8 times though

dense osprey
#

laziness

hidden musk
#

that's not laziness though. you're doing more work

dense osprey
#

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

fossil cipher
#

You might be better discussing this in the actual spoilers channel for day 11

sick wasp
#

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

honest nacelle
#

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?

torn thorn
honest nacelle
halcyon wave
honest nacelle
gleaming cedar
#

๐Ÿ˜ญ

broken cradle
#

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?||

magic oxide
#

yes

broken cradle
#

wish i had seen that sooner ๐Ÿ˜”

unique osprey
earnest forge
#

I didn't get enough sleep

#

Oh well

torn thorn
#

&aoc c

shut trellisBOT
#

Day 13 starts <t:1670907600:R>.

torn thorn
#

where's the hype ๐Ÿ˜”

placid lake
#

hello friends

torn thorn
#

hola

magic oxide
#

glhf

earnest forge
#

GLHF everyone

torn thorn
placid lake
#

good luck

#

have fun

#

bye bye

torn thorn
#

whooo

wet fiber
magic oxide
#

see yall in 3 hours

torn thorn
#

only day 13 !!!

#

no problems that built off of prev days though

#

sadge

#

10 secs

wet fiber
#

staying awake until 2:00 am 13 days in a row takes a toll on me XD

shut trellisBOT
torn thorn
#

bruh this is an eval problem

magic oxide
#

reminds me of shellfish nums

arctic gust
#

;-; i even didn't finish the 1st one

earnest forge
#

87 / 55 ๐ŸŽ‰

earnest forge
hexed axle
torn thorn
#

||how to use compare function with sort||

earnest forge
#

||functools.cmp_to_key||

torn thorn
#

ty

flat sequoia
#

Man I'm falling off

#

I didn't leaderboard the third day in a row

earnest forge
#

Rip

pine tiger
#

god

#

that was awful

earnest forge
#

I'm coming for your leaderboard spot ยฌ.ยฌ

pine tiger
#

what a crappy roblem

torn thorn
#

lmao

stable shale
#

Quite an interest one today

tepid cairn
#

might even be compound interest

magic oxide
earnest forge
#

Lmao

gleaming cedar
#

wait what does part 2 even mean

#

where am i supposed to put the divider packets, after every pair?

earnest forge
#

||add the markers, sort the data, find the markers||

gleaming cedar
#

just anywhere?

earnest forge
gleaming cedar
#

gotchu

#

thanks

covert arrow
#

nooo

#

I forgor ๐Ÿ’€

earnest forge
#

Rip

covert arrow
#

started 1h late

flat sequoia
#

this one sucks

gleaming cedar
#

i got too excited and kept the example's answer ๐Ÿ’€

#

lets goo, thanks @earnest forge

placid lake
#

snailfish or shellfish

gleaming cedar
#

bubble sort for the win x)

placid lake
#

tim sort for the win

gleaming cedar
#

rofl fuck day 9

dense nacelle
#

I liked day 9. Only had to rewrite half my program to get it to work, but it worked better because of it.

placid lake
#

day 9 was pretty fun actually

gleaming cedar
#

probably my least favorite day

#

i don't even want to try it again ๐Ÿ’€

#

grids are my biggest weakness ๐Ÿ˜ญ

mossy basin
#

don't actually need sort

magic oxide
#

day 9 was pretty fun

stray crescent
molten pasture
#

my day 12 takes 4.8s to run, is that very bad?

gleaming cedar
#

moving crates was the most fun

polar sand
#

I have no idea how to approach parsing today's problem

stray crescent
#

ok guys

#

i am lagging behind by three days

#

which is the easiest out of day-11, 12 and 13

feral hazel
#

I'd say day 13

magic oxide
#

definitely day 13

modern terrace
#

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

hidden musk
humble copper
#

my part 1 for today is getting the sample input right but not the actual input

gleaming cedar
covert arrow
#

make some test cases yourself

humble copper
#

nvm i got it

humble copper
#

just lucky, i suppose

#

(or unlucky)

#

๐Ÿ˜…

#

i know someone that's doing aoc this year in c++ to try to learn the language

earnest forge
polar sand
#

Knots

earnest forge
#

Ahh

#

Yeah that one wasn't so bad lol

#

My worst so far was day 7 lol

shut trellisBOT
#

Sorry, an unexpected error occurred. Please let us know!

CommandInvokeError: Command raised an exception: NotFound: 404 Not Found (error code: 10008): Unknown Message

tepid cairn
#

rip

mortal creek
#

&aoc join

past comet
#

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

undone jackal
#

&aoc join

molten pasture
#
[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?

gleaming cedar
#

you guys are benchmarking?!

molten pasture
#

I am, I try to make efficient and clean solutions

molten pasture
molten pasture
cyan sleet
#

ok, if so putting up my times would be unfair ๐Ÿ˜›

molten pasture
#

What language are you using?

cyan sleet
#

rust

molten pasture
#

Oh Nice

#

I did last year in Rust too

cyan sleet
#

I learned rust during last years AoC

molten pasture
#

I'd expect your times to be 2 or 3 orders of magnitude faster?

torn thorn
#

doesn't matter if it takes half a second or 0.005 of a second both are basically instant

earnest forge
#

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

cyan sleet
torn thorn
earnest forge
#

I really like that graph, how did you generate it?

cyan sleet
cyan sleet
earnest forge
#

I knew that but I meant more like is there a lib or are you just calculating manually?

molten pasture
molten pasture
cyan sleet
earnest forge
#

Fair enough

molten pasture
cyan sleet
#

good algos and fast language (and small inputs)

molten pasture
cyan sleet
#

no

#

I just mean that the inputs in AoC is just small in general

molten pasture
#

Ohhh yeah

#

good algos are the shit

#

they're like poetry fr

cyan sleet
#

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

earnest forge
#

Lmao

cyan sleet
#

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

molten pasture
#

I did simulate them alll lol

molten pasture
sweet cliff
cyan sleet
cyan sleet
sweet cliff
#

Why?

cyan sleet
molten pasture
cyan sleet
cyan sleet
# sweet cliff Why?

the secret to part 2 there is to keep the numbers small without messing up the divisor checks for each monkey

sweet cliff
molten pasture
#

That's cool, how do you detect a cycle? You compare the state with the state you had earlier?

sweet cliff
cyan sleet
molten pasture
cyan sleet
sweet cliff
earnest forge
molten pasture
cyan sleet
#

if I only had 5 I could keep the value mod 5

molten pasture
cyan sleet
#

but what about if I have both 3 and 5

cyan sleet
molten pasture
sweet cliff
cyan sleet
#

every item can be looked at indepenendently

cyan sleet
cyan sleet
earnest forge
#

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

sweet cliff
#

Yh. If 9 off example

cyan sleet
#

give an example of what you mean?

molten pasture
# sweet cliff Mod 3 mod 5?

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?

sweet cliff
molten pasture
cyan sleet
#
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, ...

molten pasture
cyan sleet
#

all those will not mess up the mod 3 check

sweet cliff
past comet
#

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

dense osprey
#

RecursionError: maximum recursion depth exceeded in comparison

does this mean that i made a bug which made the recursion infinite?

molten pasture
#

Yeah that's the most likely explanation

hybrid nimbus
#

So I have no idea about this 'advent of code' is it to late to get started?

wispy glacier
#

nope, not too late!

polar sand
#

Didn't really have any troubles with day 8 though

#

Or day 7

past comet
polar sand
#

Small mistake with day7 part 2, but it was me failing to read the question properly on 4 hours of sleep xD

hidden musk
#

i thought the rope was fun

past comet
#

same, my physics background was like "oh, time evolution, no biggy"

polar sand
#

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

cyan sleet
#

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

hidden musk
#

yeah i still don't know what that meant

gleaming cedar
royal hound
#

i saw many people on here run into that

#

where their rope would break into two upon reaching that case

hidden musk
#

huh

royal hound
past comet
#

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

gleaming cedar
#

screw the rope!1!one!1!

hybrid nimbus
#

The feeling of waiting to submit another response is oh so agitating.

past comet
#

ugh, I don't have it in me to parse brackets tonight

fossil cipher
past comet
#

let alone try to tackle the "is_ordered" function

fossil cipher
past comet
#

... eval...

fossil cipher
#

||not saying a word||

past comet
#

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

fossil cipher
#

||There's a safe alternative to such a dangerous tool.||

past comet
#

i will inquire after I solve the processing logic a better way for my import to work

woven sable
ripe crest
#

wooo finished day 4 (I'm trying, kind of cry_panda )

#

I have yet to actually finish any year because I always get distracted

woven sable
#

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?||

modern harness
woven sable
#

alr awesome, ty!

#

also for day 12 part 1 ||can you go from say z to a technically?||

modern harness
# woven sable also for day 12 part 1 ||can you go from say z to a technically?||

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

pearl charm
#

I'm still stuck at Day 7 lmao

torn thorn
#

&aoc c

shut trellisBOT
#

Day 14 starts <t:1670994000:R>.

torn thorn
#

where's the hype

wet fiber
#

whoo

magic oxide
#

hype usually starts around 4 minutes later

torn thorn
#

๐Ÿ˜”

#

we'd hype like 5 minutes before on day 1

placid lake
#

hallo

torn thorn
#

hi

wet fiber
#

a new day doesn't start without dennis's glhf

naive stone
#

&aoc c

shut trellisBOT
#

Day 14 starts <t:1670994000:R>.

earnest forge
#

Hold on wtf

#

That's not right

naive stone
#

reload

placid lake
#

glhf

earnest forge
#

(yes, I know)

gentle dust
#

I wonder if you can get a desync the other way

earnest forge
#

GLHF

gentle dust
#

and access it early ๐Ÿฅด

torn thorn
#

20 seocnds whoo

torn thorn
magic oxide
#

glhf

shut trellisBOT
torn thorn
#

o hew

tepid cairn
#

๐Ÿ‘€

torn thorn
#

what the fuck is this input

compact wasp
#

i give up

#

jk

torn thorn
#

lmao

livid gull
#

yikes

compact wasp
#

this can't just be simulationโ€ฆ right?

torn thorn
#

lmao

naive stone
#

day 17 2018 strikes again, sand edition

torn thorn
#

lmao

naive stone
#

took me forever to complete that puzzle. Hopefully i'll be a little quicker this time around

magic oxide
#

i'm so glad i bothered to make a display function last time

#

i can just reuse that

hexed axle
pine tiger
#

what a crappy run

earnest forge
#

Couple of stupid infinite loop bugs today

#

:(

earnest forge
naive stone
#

indeed

torn thorn
#

part 2 took like a solid 10 seconds for me kekw

naive stone
#

eric never misses an opportunity to link a previous puzzle

torn thorn
#

lmao

magic oxide
#

part 1 took like 5 seconds oh no

#

not optimization

pine tiger
#

||actually, there isn't any today!||

torn thorn
magic oxide
#

this is not looking good

torn thorn
#

took 3 seconds for my part 2

#

um

#

how did it take 5 for ur part 1 ๐Ÿ’€

magic oxide
#

my part 2 is still running lmao

#

it's been like 2 minutes

torn thorn
#

lmao

#

did you run it against a test case first

magic oxide
#

yeah

#

it got 93

#

so

torn thorn
#

lmao

magic oxide
#

ok i give up

#

im profiling

torn thorn
#

no

#

don't

#

let it run in the background

stable shale
#

Today looked so scary but it actually wasn't that bad

torn thorn
#

||it was just a simulation problem||

#

||it isn't bad||

stable shale
#

yeah

#

Runtime for P2 for me was 1s

torn thorn
#

damn

#

3s for me

#

||did you guys assume a board size||

late frigate
#

for some reason my code ran super fast

stable shale
#

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

late frigate
#

like < 1 second with default python interp, even when ||iteratively simulating every sand block||

torn thorn
unique osprey
#

Well i'm done parsing input...

feral hazel
#

ooh that looks great

torn thorn
unique osprey
#

that looks like a bitch

feral hazel
#

I'm loving the inputs this year

unique osprey
#

now i gotta solve it lol

torn thorn
#

a lot of them are pretty creative

noble shoal
#

Is there a leaderboard this time around?

torn thorn
#

wym

late frigate
#

Oh wait @magic oxide ||are you using an inf map or a fixed grid?||

magic oxide
#

i'm just ||storing complex numbers in a set||

late frigate
torn thorn
earnest forge
#

But yes, you totally can just use ||a grid going from (500 - max_y - 2) to (500 + max_y + 2)||

gleaming cedar
#

not the grids again nooooo

torn thorn
gleaming cedar
unique osprey
#

aaaand p2

torn thorn
unique osprey
#

๐Ÿคทโ€โ™‚๏ธ

hollow wharf
#

ah sand simulation

#

but parsing input?

earnest forge
#

How tall was everyone's input btw? Mine only went up to ||169, including the extra row of sand from p2||

earnest forge
deft thorn
hollow wharf
#

im on 10, god i hate debugging these things

earnest forge
hollow wharf
#

is there anyone available to answer a question i have about aoc 10 part 2?

polar sand
#

Asking in the solution thread would be the best spot to ask

somber garden
#

could someone help me with my code in python-help?

wanton wedge
# hollow wharf is there anyone available to answer a question i have about aoc 10 part 2?

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

graceful tapir
#

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")

past comet
#

Oh, today's is a cellular automata problem?

molten pasture
#

my day 14 part 2 takes 15 seconds to run :((((

mossy stream
#

I- uh, any clue why the day order for 2020 is this?

mossy basin
#

so the current day represents where you are

mossy stream
#

I see

#

so the day number is the chronological one?

mossy basin
#

yep

cedar stone
#

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

minor cave
hidden musk
#

just don't study for exams, that's what i do

fossil cipher
#

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 ๐Ÿ˜„

molten pasture
fossil cipher
#

3.5 s ๐Ÿ˜ฆ

molten pasture
#

What's your CPU?

fossil cipher
#

i7-9850H on my work laptop

molten pasture
#

I'm using a laptop with a Ryzen 4500

#

I don't know which is better

fossil cipher
#

yours is few years newer, I think

hidden musk
#

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

minor cave
#

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?

hidden musk
#

it's alright

polar sand
#

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

compact wasp
#

python 3.11 on m2

molten pasture
#

no JIT

compact wasp
#

damn nice

torn thorn
#

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

prisma lintel
#

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)

marsh currentBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

torn thorn
#

you can probably look at this though ^

prisma lintel
#

okay, thank you, i'm sorry)

polar sand
magic oxide
#

the threads are pretty cool imo

#

better than last year

torn thorn
#

pretty cool but annoying to search for text in

slender herald
#

this server running a sweatshop?

torn thorn
#

they're using the elves ๐Ÿ‘€

fossil cipher
dense nacelle
#

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.

minor cave
torn thorn
#

where's our hype channel ๐Ÿ˜”

minor cave
#

(what's a hype channel?)

limber needle
#

plenty of hype here ๐Ÿ˜‰

torn thorn
#

where we get hyped for the release of the new puzzle ! ! !

magic oxide
#

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

torn thorn
#

๐Ÿ˜”

#

i feel like most of the people were able to get the puzzles done

unique osprey
#

Oh there can still be hype. It's still >4hrs away

#

&aoc c

shut trellisBOT
#

Day 15 starts <t:1671080400:R>.

compact wasp
#

the puzzles aren't difficult, it's just people losing motivation

torn thorn
#

they aren't the worst

#

but like as you get later days beginners wouldn't be able to solve

compact wasp
#

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

torn thorn
#

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

compact wasp
#

i guess i don't know what a beginner is

torn thorn
#

i guess our definitions are different

#

i'm just used to the lower end of the beginner spectrum

compact wasp
#

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

torn thorn
#

you're probably looking at uni beginners

#

im looking at hs beginners

compact wasp
#

oh day 7 was the term one

torn thorn
#

?

#

yeah

#

tbf you could've just bruteforced with paths

#

but like

compact wasp
#

yeah

#

you can bruteforce all of these, which is why i'm calling them beginner problems

#

except the mod one

torn thorn
#

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

compact wasp
#

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

torn thorn
#

i admit 13 isn't the worst

#

12 is just annoying

compact wasp
#

i didn't need someone to tell me that the idea existed

compact wasp
torn thorn
#

but like it's a lot easier if you have previous experience

compact wasp
#

that's also true

torn thorn
#

which is the point i'm trying to make

compact wasp
#

is it rare to independently wonder about that idea?

#

if it is, then i stand corrected about my assessment of day 13

torn thorn
#

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

#

๐Ÿค”

compact wasp
#

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

torn thorn
#

enough monkeys on typewriters could solve any problem ๐Ÿ‘

compact wasp
#

i guess "eventually" is the difference between how we define a beginner problem

torn thorn
#

ig

compact wasp
#

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

dense osprey
#

i still have to do day 13

#

havrnt looked at the problem yet

placid lake
#

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

torn thorn
#

is eric pandering to newer peopel who joined

placid lake
#

i wonder

torn thorn
#

&aoc c

shut trellisBOT
#

Day 15 starts <t:1671080400:R>.

torn thorn
#

7 minutes

#

hype!!

pine tiger
#

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

placid lake
#

well on each re.match, you recompile the regex

#

so it's a bit slower

hidden musk
#

it should be faster with re.compile

placid lake
#

yup

pine tiger
#

would you guys recommend i go back & change it?

hidden musk
#

if you need speed

pine tiger
#

so there's nothing really wrong w/ my current way of doing things

hidden musk
#

if you don't need speed

torn thorn
placid lake
#

that would probably depend on how large your regex is

hidden musk
#

and how many times you're using it

placid lake
#

yeah

torn thorn
#

how about in san's case .-.

hidden musk
#

there's only 8 monkeys, it doesn't matter really

torn thorn
#

ig

earnest forge
#

GLHF everyone

torn thorn
#

whoo

#

hype

#

where's stickie

placid lake
#

could just do findall instead of match

torn thorn
#

and fisk

#

an ionite

placid lake
#

then it makes no difference

torn thorn
#

:(

placid lake
#

fisk is here

torn thorn
#

eh

#

hasn't talked :(

#

2 mins ! ! !

placid lake
#

good luck all

torn thorn
#

he said the line whooo

hidden musk
#

the linE!!11 โ€ผ๏ธ

torn thorn
#

omg

#

public santa void

#

itsyou

hidden musk
#

mhm

torn thorn
#

&aoc c

shut trellisBOT
#

Day 15 starts <t:1671080400:R>.

torn thorn
#

everyone is burnt out ig ๐Ÿ˜”

livid gull
#

its so cold

#

-7C

torn thorn
#

rip

#

glhf everyone

shut trellisBOT
ashen lichen
#

Hmmm, maybe I'll do day 1 now

livid gull
#

ohj no not beacons again

torn thorn
#

oh no

#

this looks painful to do

#

i am throwing hard

#

39 seconds ๐Ÿ˜”

sharp panther
#

huh. top 100 for first star is filled, but none of both.

torn thorn
#

wait i am so dumb

#

i am throwing so hard

#

wtf

molten fulcrum
devout tusk
#

Why does it not have more # in the top left?

#

There's nothing stopping the sensor

#

Unlike other sides where there are beacons

limber aurora
torn thorn
#

damn part 2 is HARD

#

wtf

pine tiger
#

well

#

better than nothing

molten fulcrum
#

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

devout tusk
#

I don't think I understand this quite well

#

There are no beacons on the top left to stop the sensor from sensing further

earnest forge
#

My code works for the test case and not for the input -_-

hexed axle
torn thorn
#

quesiton: how does tuple sorting work

#

does it compare based off of first elem

#

and if its the same then the next?

pine tiger
torn thorn
#

kk ty

#

ok i have an idea

#

but it's burning my computer up

#

it didn't take too long

#

forunately

covert arrow
#

I'm downloading numba on 25kbps internet

pine tiger
#

i'll savor this while it lasts

devout tusk
pine tiger
#

oh wait

#

do you think it's euclidean distance

#

& not manhattan

devout tusk
pine tiger
#

yeah it's manhattan distance

#

and this would be a manhattan distance of let's see

#

9?

torn thorn
#

i am kinda throwing

#

MMM

wet fiber
devout tusk
pine tiger
#

np!

torn thorn
#

i found where i fucked up

#

EEE

pine tiger
#

nice

torn thorn
#

ok nvm i'm throwing again

pine tiger
#

ffff

torn thorn
#

wait i'm so dumb

#

i mixed up rows and columns

earnest forge
#

Rip

torn thorn
#

still my solution doesn't work

#

why

#

i am dying

placid lake
#

naive way of doing this was a mistake

earnest forge
#

Maybe I'll get top 1k for part 2 after all

pine tiger
earnest forge
#

Not entirely sure which will finish first

pine tiger
#

LOL

#

is that vsc?

earnest forge
#

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

torn thorn
#

lol

tepid cairn
earnest forge
tepid cairn
#

ah, I didn't have context for the puzzle, sorry

earnest forge
#

Dang, not top 1k

torn thorn
#

rip

magic oxide
#

shame I'm not at home yet

torn thorn
#

ahahahahahahahaha ifinished it

#

kill me

magic oxide
#

part 1 seems pretty easy

torn thorn
#

naiive solutions won't work

#

all im gonna say

earnest forge
#

also I made the mistake of trying the naive way

torn thorn
magic oxide
#

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

torn thorn
#

xd

earnest forge
magic oxide
#

oh shit

torn thorn
earnest forge
#

Also I ||accidentally drew big triangles instead of diamonds|| so that didn't help

torn thorn
#

it worked for me .-.

earnest forge
#

Yes

hearty vigil
#

Hello.

torn thorn
#

hi

hearty vigil
#

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?

magic oxide
#

not the right channel

torn thorn
#

i feel like it's against pydis rules too

magic oxide
hearty vigil
#

My bad.

magic oxide
hearty vigil
#

Nvm.

torn thorn
#

!rule tos

marsh currentBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.

feral hazel
#

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

magic oxide
#

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?||

feral hazel
magic oxide
#

||what about if a sensor is there||

left yew
#

for part2 I am getting multiple possible distress positions and the problem says only one should be there

feral hazel
left yew
magic oxide
#

well then

rugged merlin
#

when you start to think maybe you should rethink your approach

magic oxide
#

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

north silo
polar sand
#

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

molten pasture
#

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

fossil cipher
#

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 ๐Ÿ˜ฆ

molten pasture
#

I also got stuck on that one

#

Might have an idea for solving the second part

polar sand
#

Doing the same. Mine will probably take a few minutes though and not a few seconds

#

Not really sure how to optimize it

molten pasture
#

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?