#advent-of-code

1 messages Β· Page 7 of 1

fossil cipher
#

AoC can be very time-consuming.

#

whether it's struggling to find an working solution... or wondering if you can improve what you have... it can be a real time vampire πŸ˜„

modern terrace
magic oxide
#

it took me like 2 weeks after the new year to finish last year's aoc

#

hoping that won't happen again this year

lunar jackal
#

how are people solving with brute force in 1 minute
took me like 10mins
didn't help that my y position was 3.1mil

rose otter
#

I'm guessing with luck?

#

Or smart pants code

hidden musk
#

nah. almost screwed me with exams lol

feral hazel
molten pasture
#

Basically I have to check every row, but checking each row is very fast

#

It takes a minute to bruteforce with plain python and 7 seconds with pypy

halcyon junco
#

I’m on day 5. Would it be cheating to manually enter the initial values for the stacks?

rapid wolf
#

no, but it makes the problem a bit less interesting IMO.

halcyon junco
#

I’m so bad at working with this kind of stuff lol

#

Wait I might have an idea actually lol

hollow wharf
#

Tomorrow's twist is that the distress signal is coming none other than from the trapped elves

hidden musk
#

πŸ™€

halcyon junco
#

The ideal/correct way to solve Day 7 ||the file system one|| is with ||recursion|| right?

#

Just wanna double check before I throw myself down this rabbit hole

pine tiger
#

yeah

torn thorn
#

depends on how you setup your filesystem

past comet
#

is there somewhere I could get more test inputs for day 14?

low condor
past comet
#

no, I realize now I had the same off by one in both cases, but I'd misread a 94 for a 93 so I thought I was passing the test case

sharp panther
#

you know, generating test inputs for fun would be kinda cool

naive stone
past comet
#

this should give 4 for part 2 498,2 -> 502,2

#

well, I think that's enough for me today

#

need to swap out for automated tests instead of visually inspected ones :/

pine tiger
compact wasp
#

noticing a pattern here

#

i guess this means i will do shit today

pine tiger
#

wow

#

that pattern

#

is scary

broken cradle
#

Somehow managed to crash my computer by using all of the memory on part 2 today

compact wasp
#

either low ram or you actually brute forced it

broken cradle
#

16 gb

tepid cairn
#

download more RAM 😀

compact wasp
#

yeah you def did it wrong

broken cradle
#

Yeah I assumed so

#

I started running it then I took another look at those numbers and was about to stop the program πŸ’€

compact wasp
#

lol

#

16 trillion

pine tiger
#

smh

#

just get a better computer

broken cradle
#

There’s gotta be some kind of math that I don’t know that would make this easier

compact wasp
#

it's literally algebra

#

πŸ’€

#

are you in middle school? otherwise you should know

broken cradle
#

uhh

#

no...

compact wasp
#

πŸ˜”

broken cradle
compact wasp
#

turn the manhattan distance into an equation

#

boom, now you have a system of equations

#

i will refrain from revealing how you solve that system

agile dew
#

Symbolab

compact wasp
#

πŸ’―

#

a+ for you

agile dew
#

ty

magic oxide
agile dew
#

wait where is the question

compact wasp
agile dew
#

or the aoc for today

#

tyty

compact wasp
#

i guess understandable since it was 1 am

#

but πŸ’€

agile dew
#

oh this is way outta my skill level lmfao

compact wasp
#

rip

#

nah trust, you got this

#

we're still in freelo mode

agile dew
#

im struggling with roman to integer rn

magic oxide
#

I was like "ok the lines are perpendicular so we can take the dot product of the direction vectors" and then I realized that was stupid because I already knew the direction vectors

compact wasp
#

lol

agile dew
magic oxide
#

and then I was like "I have three unknowns and two equations I think this is impossible"

#

and I got stuck on that for like 10 minutes

compact wasp
#

πŸ’€

misty oriole
#

yo

#

i need help

#

im trying to code a bot for discord but I cannot figure out how to make a /set channel command and /set role command. if someone could help that would be amazing.

compact wasp
#

wrong channel

broken cradle
#

welp, looks like it's hit the part where it's beyond my skill level

compact wasp
#

rip

#

gotta grind algebra frfr

broken cradle
#

I get systems of equations and stuff but idek how I would find ||a missing point out of a bunch of squares||

compact wasp
#

intersection of lines

#

you push them by 1 unit and then find where 4 of them intersect

#

basic algebra frfr

broken cradle
magic oxide
#

because I just ||iterated over all combinations of length 4 of all the rhombus sides and then all 64 permutations of the 4 sides of the 4 rhombuses and I feel like it was really inefficient||

compact wasp
#

oh i did not do the algebraic approach

magic oxide
#

oh

#

I tried brute forcing and it took like a minute to just do 20k rows so I figured my laptop wasnt built for that

dusky geode
#

Hello, guys. I don't know where to ask. I'm firmly stuck on Day 11, part 2 (those monkeys). And the only question I have is if linear algebra knowledge is required to solve this. If yes, I'll just calmly give up. I don't want spoilers, otherwise would just have looked at the forum thread.

modern harness
#

Does anyone know how to search the threads? Someone posted a neat coord class the other day that I wanted to look back at.

#

Not sure which day, but even if I knew the day, I'm really not seeing any way to search it

modern harness
covert arrow
covert arrow
#

search for "class coord" maybe?

magic oxide
#

maybe restrict the days to ones that actually had coordinates in the puzzle

modern harness
earnest forge
covert arrow
#

use the default discord (server-wide?) search

earnest forge
modern harness
#

Thank you, thought I had tried that already

earnest forge
dusky geode
earnest forge
dusky geode
# modern harness Whats the issue you're running into?

Worry levels reach "unmanageable" values, as written in the task. I tried to use symbol math to see what's happening and could not find anything useful, like, for instance, dividers "accumulating" in the worry levels, to reduce those. Also I calculated worry levels of an item for the first 100 rounds and printed some first dividers of those. Cannot see any pattern.
I will continue thinking, thanks for asking.

feral hazel
modern harness
earnest forge
modern harness
#

You're right, this is the perfect place for small hints

earnest forge
#

small hints

#

Yeah

feral hazel
earnest forge
feral hazel
#

!e

from dataclasses import dataclass

@dataclass
class Coord:
    x: int
    y: int

    def __hash__(self):
        return hash((self.x, self.y))

a = Coord(2, 3)
s = {a}
a.x = 4
print(a in s)
marsh currentBOT
#

@feral hazel :white_check_mark: Your 3.11 eval job has completed with return code 0.

False
feral hazel
#

you can compare it like a tuple

earnest forge
#

Points shouldn't have an order for the same reason complex doesn't

earnest forge
feral hazel
#

ah I like having it as a class because I can add methods to it```py
@dataclass(frozen=True, order=True, slots=True)
class Point:
x: float
y: float

def rotated(self, angle_deg: float, pivot: Optional[Point]=None) -> Point:
    if pivot is None:
        pivot = Point(0, 0)

    px, py = pivot

    x, y = self.x - px, self.y - py

    angle_rad = radians(angle_deg)

    s = sin(angle_rad)
    c = cos(angle_rad)

    x, y = c*x - s*y,  s*x + c*y

    return Point(x + px, y + py)

def __iter__(self):
    return iter([self.x, self.y])

def __getitem__(self, i):
    return [self.x, self.y][i]

def __repr__(self):
    return f"({self.x:+.02f}, {self.y:+.02f})"```
earnest forge
#

Inherit from namedtuple?

feral hazel
#

that would indeed work

#

yeah looks good but it feels weird inheriting from something in typing```py
from future import annotations

from typing import NamedTuple, Optional
from math import radians, sin, cos

class Point(NamedTuple):
x: float = 0
y: float = 0

def rotated(self, angle_deg: float, pivot: Optional[Point]=None) -> Point:
    if pivot is None:
        pivot = Point(0, 0)

    px, py = pivot

    x, y = self.x - px, self.y - py

    angle_rad = radians(angle_deg)

    s = sin(angle_rad)
    c = cos(angle_rad)

    x, y = c*x - s*y, s*x + c*y

    return Point(x + px, y + py)
earnest forge
#

I meant inheriting from the collections version lol

#
from collections import namedtuple

class Point(namedtuple('Point', 'x y')):
  ...
feral hazel
#

ah I think I prefer the syntax of the typing one though
the attributes also don't have types unless you do what you'd do for NamedTuple

earnest forge
#

(you can type-hint the members even if you inherit from collections namedtuple)

#

((just don't set a default))

feral hazel
#

unless you do what you'd do for NamedTuple

earnest forge
#

(((in fact don't do that anyway it messes with your type checker)))

#

Anyway glhf everyone, puzzle drops in 2 minutes!

torn thorn
#

&aoc c

shut trellisBOT
#

Day 16 starts <t:1671166800:R>.

feral hazel
#

yep lego

earnest forge
#

I mean I could have done that if I could be bothered

#

<t:1671166800:R>

#

You're welcome

compact wasp
#

alright it is time for me to get fucked by day 16

earnest forge
#

Lmfao

#

Enjoy

compact wasp
#

according to my calculations, i will place in 4 digits

torn thorn
#

whoo

#

20 seconds

#

where's dennis's

compact wasp
#

pretty much every even day i place in 4 digits, and every odd day i place in 3 digits

torn thorn
#

glhf

#

πŸ˜”

shut trellisBOT
torn thorn
#

ew

tidal bloom
#

Oh yeah

#

Time to sleep

covert arrow
#

oh crap

#

i forgot

torn thorn
#

is this more graph problems

compact wasp
#

why can't i open my terminal

#

fuck

magic oxide
#

great more ||graph problems||

#

and still no internet

torn thorn
#

hm

#

i don't think a naive solution will work

earnest forge
#

I think you might be right

stable shale
#

Doesn't look like a plain graphing problem. This is gonna be...interesting

torn thorn
#

isn't this just a ||wandering salesman||

compact wasp
#

πŸ’€

earnest forge
#

I figured out the optimisation lol

torn thorn
#

i didn't

#

:(

earnest forge
#

Nvm it didn't work

torn thorn
#

i feel like its like a ||weird type of pathfinding||

earnest forge
#

Uhh

#

Hold on what

modern terrace
#

30 minutes in and still no thread πŸ₯²

#

we're struggling

torn thorn
#

question: ||will you always want to open the current node before traversing to another tunnel||

#

no you won't

#

damn

modern terrace
torn thorn
modern terrace
#

you literally ||just leave it at wherever the last place to open something is||

torn thorn
#

||go to 1 -> open 1 -> go to 30 -> open 30 vs go to 1 -> go to 30 -> open 30 -> go to 1, second is better because you have an extra minute to relieve pressure||

compact wasp
#

imagine this is ||mcts||

torn thorn
#

this is actually really interesting

#

never heard of it kek

compact wasp
#

||monte carlo tree search||

torn thorn
#

||explanation of how it works?||

modern terrace
#

i guess ||calculate cost using how near the valve is and how much flows from it||

#

this is a ||web|| and not a ||tree|| isn't it?

stable shale
#

A grand total of 2 people in here have solved anything for today. Me concerned

torn thorn
#

yeah naive solutiosn won't work for part 1 idt

compact wasp
#

yeah i've tried

stable shale
#

I gave up even trying to implement the naive solution

compact wasp
#

it does not work

modern terrace
#

i don't even have a solution yet

torn thorn
#

same

stable shale
#

Honestly just gonna wait for the Reddit thread to open and smart people to explain how to do it

torn thorn
#

not many people do

stable shale
#

I'm betting it's some math trick

modern terrace
#

i ust wanna find a way to ||calculate the cost of the valve distance with its flow rate|| and somehow use that

#

that's the only problem if i understand correctly unless ||lookaheads|| are required

compact wasp
#

pruning via ||cycle detection||?

stable shale
#

Probably wouldn't help

devout tusk
#

||Seems like a version of knapsack today? Yay or nay? ||

pine tiger
#

how would that work

torn thorn
#

||any way to do memoization based off of open valves/minutes_left||

modern terrace
#

i'm just using chatgpt

torn thorn
#

πŸ’€

stable shale
modern terrace
#

i can't think of anything because i'm not an algorithm solver especially when there are paths

torn thorn
#

chat gpt gives a naive solution

#

there's ||2^n subsets damn for a set of size n||

devout tusk
#

Protip : ||Calculate by hand βœ‹ 😌 ||

torn thorn
#

WAIT

stable shale
#

Is that actually doable?

compact wasp
#

yes

#

it is

#

but i won't

stable shale
#

How would you even ||calculate by hand||

#

Draw and try?

torn thorn
#

||is 1e16 combinations too big||

stable shale
#

I'm just gonna do this tomorrow when all the smart people've figured it out. Good night and good luck

devout tusk
compact wasp
torn thorn
#

||it'll be the upper bound||

#

||at most subsets of 15 from 66 different sets, and 30 different minutes for each||

compact wasp
#

here's my graph btw

torn thorn
#

wait

compact wasp
#

obviously a lot less than 1e16 from common sense

torn thorn
#

yeah

modern terrace
#

for all i know ||wandering salesman needs to return to its original point||

torn thorn
#

||also wandering salesman doesn't want to repeat nodes right?||

modern terrace
#

this ||does not||

torn thorn
#

is this cache logic possible

#

hmm

wet yoke
#

There's only a few worth reaching to release any pressure, it seems.
All but 15 are flow rate 0 on mine. πŸ€”

torn thorn
#

wait

#

that's

#

a interesting look

covert arrow
#

||all the flow rate 0 valves (except AA) seem to have 2 paths, would flattening these paths help?||

torn thorn
#

||yes probably||

pine tiger
#

think that would harm more than help

torn thorn
compact wasp
wet yoke
#

My eyes so far

compact wasp
#

things are more visible in this one

torn thorn
#

things

#

with flow 0

compact wasp
#

actually wait, i should try flattening paths

covert arrow
#

I already did

hollow wharf
#

can somebody helpe me with 11 part 2?

covert arrow
#

||eg if you had AA <-> BB <-> CC but BB has flow rate 0 you can flatten it to AA <-> CC which takes 2 minutes to travel through||

hexed axle
torn thorn
#

wait this graph is directed

#

um

#

i think?

#

wait no

#

i'm just dumb

devout tusk
#

Idk about that but @compact wasp 's graph sure is pretty sus. Looks like an amogus if you look the right way

torn thorn
#

i think i got it to work?

#

my flatten at least

compact wasp
#

graph is undirected

torn thorn
#

yeah

#

i just forgot to update some stuff

#

my flatten code is dumb

#

very very dumb

hollow wharf
#

can somebody give me a hint for 11 part 2?

#

i dont want to look at the spoilers and ruin it

#

but im getting increasingly worried this is some math trick

magic oxide
#

don't overthink it

#

it is a math trick

hollow wharf
#

oh hell

modern terrace
#

what's an optimal way to ||combine cost of valve and length of path|| because i'm doing that rn

#

wait i got it

#

valves are opened right as they should be

torn thorn
#

||you can multiply time left by the flow amount to get the total pressure you'll relieve at any time||

modern harness
#

My part 2 is both wrong on the example AND takes a really long time just for the example. I'm surprised its so much worse than part 1 in terms of timing.

torn thorn
#

im still doing a naive searching algorithm

#

hmm

leaden kettle
#

should i turn off github copilot for advent of code?

#

feels like cheating so im going to, but also it helps with some tedious parts when im problem solving

torn thorn
#

do what you want to do

covert arrow
#

seems about right (flattened paths)

#

now how do I navigate it

torn thorn
#

ok i'll try to make a cache

#

RIP computer memory

#

im gonna come back to a blue screen

hollow wharf
magic oxide
#

think about some operation that you can do to make the numbers smaller, but their divisibilities by all the monkeys remain invariant

hollow wharf
#

i can think a few, but they would involve not reusing my part 1 solution, right?

#

the time consuming op is the squaring operation, but the other ones alter the numbers enough to make each step different

#

or am i timing it wrong? is the division that is overtaxing?

torn thorn
#

ok yeah i'm not gonna do this now

#

it's 2 am and i have like 2 tests tmr

#

gn

hollow wharf
#

but i need to pass the squared numbers to the next monkey, else if they are not squaring i dont get the real answer

hollow wharf
#

@magic oxide okay i got it

#

but why

magic oxide
#

wdym but why

hollow wharf
#

why does it work

#

i changed my //3 for a modulo for the lcm

#

by cheating

#

i don't get why it works

#

some monkeys do addition

magic oxide
#

adding two numbers and then taking mod n is equivalent to adding the two numbers mod n

#

same with multiplying

earnest forge
magic oxide
#

basically it stays the same

hollow wharf
#

well i can see it in a clock

#

16 + 2 = 4 + 2

magic oxide
#

sure

hollow wharf
#

but i would expect to have to multiply the result

#

ooh

#

but the result is the times visited

earnest forge
#

This is why modulo arithmetic is often introduced as 'clock arithmetic'

magic oxide
#

multiplication also preserves it

hollow wharf
#

i see it now

earnest forge
hollow wharf
#

yeah i see it now

#

i don't care about the actual numbers passed around, im just counting the pass arounds

#

i assume by that that there might be even better solutions?

#

where you don't even have to model the actual rounds?

compact wasp
#

πŸ‘€

earnest forge
#

Some people did cycle-tracking solutions to skip most of the rounds

#

But AFAIK that's the only way of skipping computation

hollow wharf
#

wdym by cycle-tracking?

earnest forge
#

A -> B -> C -> D -> A -> B (cycle detected, BCDAB)

#

The key observation is that once an item passes a divisibility check once, it will always pass the divisibility check

hollow wharf
#

the items change number on all passes

#

ooh

#

you mean when they cycle back to a monkey they regain the divisibility?

earnest forge
magic oxide
#

lmao

magic oxide
#

my first official theorem I learnt was fermat's little theorem

#

and then I had to backtrack and figure out a lot of the stuff about modular addition and multiplication myself

hollow wharf
#

did you do cs?

magic oxide
#

I'm not in uni yet

hollow wharf
#

will you be going into cs?

magic oxide
#

prolly

#

I'm more of a math guy tho tbh

real belfry
#

Hello?

lost owl
hollow wharf
#

obnoxiously so

cyan sleet
hollow wharf
#

yep

fossil cipher
#

CS doesn't even like programming.

#

CS: I have created this wonderful algorithm
Programmer: Cool, how do we implement it?
CS: Sir, I think you should leave.

cyan sleet
fossil cipher
#

One lecturer I had was an amazing computer scientist. extremely knowledgeable. His programming skills weren't amazing lol (by their own admission, too)

rapid wolf
#

yeah, programming is fairly different from the more theoretical nature of CS research.

hollow wharf
#

CS is some kind of weird maths

#

but it depends

hidden musk
hollow wharf
#

without the math??

hollow wharf
#

cs is basically math

proud cosmos
#

I'm struggling so hard

#

I don't see how I'd optimize this past brute force and guessing

magic oxide
#

do it by hand πŸ‘

magic oxide
#

was really kinda just do whatever you want related to programming

#

and if you could like write bare minimum python you'd be ok

#

not really related to cs too much

#

no algorithms or anything

#

closest thing would've been binary

pure saddle
#

Does anyone know how do I unsub from aoc pings?

magic oxide
#

you get pinged for aoc?

pure saddle
#

Yea

#

But i haven't got the time recently to solve the newer ones so the pings were a bit annoying

minor cave
pure saddle
#

!unsub

limber aurora
#

im really confused how to use the aoc module that lets you get your puzzle input directly

#

this is the module but i don't understand what oc is or what i need to do to do to be able to link it to my account and use it

tepid cairn
#

!pip aoc-lube maybe take a look at this? It's pretty neat

marsh currentBOT
limber aurora
minor cave
limber aurora
#

(this was at the start of their code)

tulip harbor
#

What's the basic approach I should be taking with day 12? I know it's finding shortest path but I don't really know where or how to start.

#

(I want to know what to do without knowing how to do it πŸ™ƒ )

dense osprey
agile dew
#

Is there a beginners advent of code

#

Like leetcode easy medium type shit

compact wasp
#

first few days is beginner aoc

#

just don't do the 2nd half lol

pine tiger
#

bruh today was

#

awful

compact wasp
#

nah today was great

#

i like how everyone was slow, let me place higher on the leaderboard

pine tiger
#

i hate you \s

open ice
#

Extremely insightful

compact wasp
#

no clue how that happened

candid berry
#

I had a ton of trouble getting part 2 working

#

My ||dynamic programming|| approach for part 1 didn't work out at all for part 2, and figuring out that I needed to abandon that approach took me a long time.

compact wasp
#

mine did πŸ˜„

candid berry
#

πŸ˜„

tulip harbor
# agile dew Is there a beginners advent of code

When I started doing AOC, I would look at everyone else's solutions if I had no idea where to begin. I started in 2020, and get a little better every year. This year, I'm asking for hints and approaches before I start looking deeply at other's solutions. If you're newer, make it your goal to try to understand the solutions of others. πŸ™‚

compact wasp
#

this is my first year doing aoc, so noted

polar sand
#

Going to come back to today's problem this weekend. Didn't have a lot of free time today sadly

modern terrace
compact wasp
#

like 4

balmy dome
#

can i join

frigid mural
compact wasp
woven solar
#

sorry people, seaborn has spoken, we'll hit zero players by day 22, p=0.05

compact wasp
#

when will we hit 0 if it's linear

woven solar
#

looks like 20 or so

covert arrow
#

probably day 17 or 18

#

oh really?

woven solar
#

depends on whether you weight it, I looked at the flatter tail

#

either way, future's looking bleak πŸ₯΄
in AoC as well, I mean

covert arrow
#

what was it like before day 16?

woven solar
#

about the same, the model's just bad here

compact wasp
#

did previous years have big jumps like this?

covert arrow
#

makes sense tbh, the earlier problems were opened, well, earlier

#

during the event, maybe

#

but I don't see any big jumps at a glance

#

also, the chart on the website is linear

woven solar
#

on average, each day leaves 85% players still playing, this year

#

so with no more big jumps, we should expect around 3k players remaining by last day

muted aurora
#

honestly after last 2 days I've kinda lost motivation

#

this isn't turning out to be the "quick puzzles" I was hoping for

compact wasp
#

just do them faster

muted aurora
#

too stupid

compact wasp
#

πŸ˜”

magic oxide
tepid cairn
#

pft, I manage lightspeed submissions 😀

modern terrace
muted aurora
#

i was so fast first few days

#

because ez

#

but now i have to think and brain no work 😦

#

day 4 prolly my peak achievement

modern harness
muted aurora
#

This was my first time :^)

magic oxide
#

nice

tepid cairn
torn thorn
#

&aoc c

shut trellisBOT
#

Day 17 starts <t:1671253200:R>.

torn thorn
#

5 minutes

#

hypee

viscid elbow
placid lake
#

hello hello hello

torn thorn
#

hola

magic oxide
#

glhf

torn thorn
#

1 minute

#

wheee

#

&aoc c

shut trellisBOT
#

Day 17 starts <t:1671253200:R>.

magic oxide
#

this is gonna be another painful day

muted aurora
#

im just gonna do it tomorrow so I don't stress myself with time and enjoy it

magic oxide
#

yeah I'm outside rn

#

so can't even do it anyways

torn thorn
#

im gonna stay up until 2 anyways so might as well

placid lake
#

good luckkk

torn thorn
#

:kek

#

whooo

earnest forge
#

GLHF

muted aurora
#

I'm gonna be up as well but if I start now I'll want to finish fast, as opposed to if I'm already 12 hours late

shut trellisBOT
torn thorn
#

omfg this is tetris isn't it

placid lake
#

this input looks funny

compact wasp
#

fucking tetris

modern terrace
#

is this tetris

magic oxide
#

actually tetris

torn thorn
#

lol??

muted aurora
#

simulate tetris lmfao

magic oxide
#

oh ffs they even have the 2022 number in there

muted aurora
#

no thanks

placid lake
#

lmaooo

magic oxide
#

like a math competition

torn thorn
#

lmaooo

modern terrace
#

just an ||itertools.cycle()||

magic oxide
#

doesn't seem too bad to brute force

torn thorn
#

yeah

magic oxide
#

until part 2 is like "the elephants now want you to find out how tall the tower is after 2022^2022 cycles

torn thorn
#

πŸ’€

magic oxide
#

or part 2 is actually just "now the row disappears if it's filled"

torn thorn
#

i am throwing

#

so hard

hexed axle
flat sequoia
#

lol part 2

modern terrace
#

i'm still at the base code

torn thorn
#

part 2 ew

modern terrace
#

how do you even

#

how do you do part 1

#

i can do it mentally but not in code

pine tiger
#

is this ||cycle detection||?

pine tiger
hexed axle
torn thorn
#

uhoh

#

wtf is pt 2

flat sequoia
#

idk what's wrong with my ||cycle detection||

#

this should work

#

but it's not working

flat sequoia
#

almost certainly

torn thorn
#

||which cycles would you detect though? input doesn't seem to have repeating elements||

pine tiger
torn thorn
torn thorn
torn thorn
flat sequoia
#

let's gooo

#

i'm done

pine tiger
#

hey oliver

#

||how far down did you have to check? 4? 5?||

flat sequoia
#

uh idk

#

||i just did the top 100 rows to be safe||

#

lmao

pine tiger
#

????

flat sequoia
#

||but you also have to take into account the wind and the piece||

pine tiger
#

||wait wtf even with top 100 rows it's the cycle still happens remarkably fast||

flat sequoia
#

well yeah

#

that's how it's designed

#

man this is so sad

#

i haven't leaderboarded in so long

#

||but you don't actually need to do all the pieces it was just easier to implement||

#

||you can just get the heights||

torn thorn
#

i am throwing so hard

placid lake
#

same

#

i have an off by something error somewhere

torn thorn
#

||for cycle detection, do you just try to find like a repeating top 100 rows and just gather the rows every time you wrap back around to 0?||

#

||i noticed for my input it seems like every time it wrapped around to 0 the same shape always repeated||

flat sequoia
#

||why does it have to wrap back to 0||

#

||also just do the heights turns out it's way easirer||

compact wasp
#

i threw hard on part 1

#

idk why i took so long

#

now i'm done with both

flat sequoia
#

||i just thought of it right after i finished implementing getting the top 100 rows, and that worked, so i was too lazy||

earnest forge
compact wasp
torn thorn
#

wow

compact wasp
#

basically simulated the thing ||but remembered certain shapes||

#

once you see something you won't need to simulate it again

torn thorn
earnest forge
compact wasp
#

aka just ||cycle finding||

#

i did top 50 rather than top 100

torn thorn
#

||i am throwing on the cycle finding part πŸ˜” ||

earnest forge
#

Stupid typo got me

#

-_-

#

128/528

compact wasp
#

1168/416 lmao

#

i'm bad with simulation

#

smooth sailing once i figure it out

dim pivot
#

Is this good

compact wasp
#

better than me lol

earnest forge
#

I think you have more points than I do lol

#

I have 243

compact wasp
#

i have 0

dim pivot
#

today was my favourite puzzle yet

#

i was stuck debugging part 1 for 20 mins

#

because i handcoded one of the rock shapes incorrectly

#

😦

earnest forge
#

It was all right aside from my stupid typos

dim pivot
#

i did the l the wrong way round

earnest forge
pine tiger
dim pivot
#

what

#

it was fun

#

...

#

yesterday was my least favourite

pine tiger
#

i thought yesterday was fine

dim pivot
#

oh my god

#

hardest aoc puzzle ever

#

how was it fine

pine tiger
#

have you seen 2019 day 22

dim pivot
#

i had no idea what to do

#

no

pine tiger
#

yeah, you should check that one out

dim pivot
#

did you need to know some maths

pine tiger
#

so much math

dim pivot
#

what math

pine tiger
#

modular arithmetic

dim pivot
#

thats not that bad

#

lol

pine tiger
#

then do it

#

i dare you

dim pivot
#

like do you need to know stuff like crt and flt

#

because i can use sympy for that

#

lemme try it now

pine tiger
#

it's p2 bw

#

*btw

devout tusk
#

Did you simulate the entire Tetris like game or are there any other interesting ways to do it? Only hints please

pine tiger
#

for p1 or p2?

devout tusk
pine tiger
#

oh yeah i simulated it lol

compact wasp
#

yesterday was my favorite so far

#

was great

pine tiger
#

the one thing about yesterday

#

was that it required

#

looking @ the input

#

and noticing something about it

devout tusk
flat sequoia
#

that ||a lot of flow rates were 0?||

#

yeah

pine tiger
#

yeah

compact wasp
#

yeah

devout tusk
#

Ah cool

#

Is p2 like, give solution after 20,222,022 rocks now and optimise. Or something more creative?

#

Just a yes or no will suffice

lunar jackal
#

it's give how many after 1 trillion rock drops

devout tusk
torn thorn
naive stone
#

ugh, these elephants are rude

livid gull
#

wow thats a lot of people from one company in the top 100

devout tusk
magic oxide
livid gull
#

not too many tho

#

only 26 in the top 100 for p2

dim pivot
#

but i guess i do olympiad number theory a lot

#

so

#

i knew what to do

#

i did google code for the ||inverse|| but thats allowed in the actual aoc

#

the only hard thing was finding the ||geometric progression|| but ||wolfram alpha|| is a lifesaver

tropic stone
#

how do you draw the table ?

devout tusk
dim pivot
#

no

#

2019 day 22 p2

devout tusk
dim pivot
#

😦

devout tusk
#

huhh

#

mine was like 160ms. wot- πŸ’€

dim pivot
#

not 1h runtime

#

1h coding time...

woven solar
pine tiger
muted aurora
#

I think I'm done with AoC this year I really don't feel like simulating Tetris just sounds annoying

mossy basin
#

kinda felt the same way, but w/e

past comet
#

I suspect I will need to be clever for day 16

woven solar
#

day16 is definitely the hardest so far, 60% of day15 solvers didn't solve day16

#

day17 is actually second hardest by that metric, at 40%, but that might drop a little as stragglers solve it. second hardest so far does sound about right for it though.

low condor
#

Hey there. Looking for hints on 2022 Day 16 P1. Have opened a help channel here: #1053756481696170044 message . Anyone who can provide hints are much appreciated :)

honest nacelle
#

Man I really wanna stick with it but I'm literally getting headaches trying to figure this stuff out

torn thorn
#

rip

honest nacelle
#

So far for Day 16 part 1, I've got ||a graph and dijkstra's algorithm calculated for the distance of every node to every other node||

I think this essentially gives me ||a complete, weighted, non-directional graph since I can map every node to every other node|| but I'm not sure if that's how this works

What I can't figure out is ||how to calculate the tradeoff between opening a valve and traveling. Multiplying the distance by the flow lost traveling doesn't seem to do it||

I have gotten the example answer by both ||brute force testing each permutation and and a genetic algorithm||, but of course those are too inefficient to deal with the full input, let alone whatever they throw at me in part 2

Could I get a small hint here? Does it have something to do with ||limits||?

torn thorn
#

||you can do a naive solution with dp for pt 1 iirc||

honest nacelle
#

||I'm not terribly familiar with dynamic programming, does this basically mean to store the calculations of a subset of traveling between nodes as we go?|| I've not got the faintest on how to do that, might lose tomorrow to thinking

modern terrace
#

day 17 visualization (spoiler)

honest nacelle
#

So I revisited my ||genetic algorithm|| with a vastly simplified ||graph|| and it actually got the right answer almost right away

hidden musk
little igloo
#

e

earnest forge
#

4 minutes!

#

Good luck everyone

covert arrow
#

GLHF

earnest forge
#

Saying more than that would basically result in outright telling you the answer, but that should be enough for you to figure it out, broken into spoilers where appropriate

naive stone
#

&aoc c

shut trellisBOT
#

Day 18 starts <t:1671339600:R>.

compact wasp
#

time to die

earnest forge
#

Lmfao

#

GLHF

torn thorn
#

oh shit

compact wasp
#

gonna choke so bad

torn thorn
#

ong

#

inb4 crt pt 2

shut trellisBOT
torn thorn
#

omg

placid lake
#

good night

torn thorn
#

this looks painful

#

hi dennis

magic oxide
#

not another cuboid day

#

bruh

placid lake
#

oh it's just a voxel mesh

#

i think?

#

anyway

#

i need to wake up in 5 hours

compact wasp
#

rank 38 holy shit

magic oxide
#

bruhh

#

I haven't even finished reading the problem yet

#

wtf

torn thorn
#

my code fucked up

#

bruh

#

25s

#

kms

#

i accidently typed ||(1, -1, 0)|| instead of ||(0, -1, 0)||

muted aurora
stable shale
#

Not doing this one at midnight. I need my sleep...

earnest forge
#

I don't understand the question for part 2

#

Wait yes I do it just doesn't work

compact wasp
#

part 2 is… i need time to think

#

would be a lot easier if i knew this thing were convex

lunar jackal
hexed axle
pine tiger
torn thorn
pine tiger
#

well

torn thorn
#

am i having a reading diff

naive stone
#

i'm confused by part 2, i don't understand what it's asking

earnest forge
#

Stupid logic errors caused by writing code at 5AM :D

torn thorn
#

I AM SO DUMB

#

HOLY SHIT

#

i copy / paste diff again

#

bruv

earnest forge
earnest forge
torn thorn
#

supposed to be like this rigth?
||for i in ((1, 0, 0), (-1, 0, 0), (0, 1, 0), (0, -1, 0), (0, 0, 1), (0, 0, -1)):||

#

i had

#

||for i in ((1, 0, 0), (-1, 0, 0), (0, 1, 0), (0, -1, 0), (0, 0, 1), (0, 0, 1)):||

earnest forge
#

LMAO NO

torn thorn
#

kms

torn thorn
earnest forge
#

I did that for the CRT one don't feel bad

#

Had 140, 101 in my check list

earnest forge
torn thorn
#

lmao

compact wasp
#

damn

#

i did poorly

#

38/331

torn thorn
#

||THE HTING WAS, IT DIDNT MATTER FOR PART 1 CAUSE ????||

compact wasp
#

actual diff

covert arrow
#

Can we assume ||there's only 1 air pocket?||

earnest forge
earnest forge
torn thorn
#

||it was just a different coordinate||

#

😭

torn thorn
pine tiger
covert arrow
#

alr

naive stone
pine tiger
#

yeah

naive stone
#

ah ok

earnest forge
covert arrow
#

I thought so

earnest forge
#

I found 32, if you were wondering
Here's a ||list of sizes||:
||[991, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]||

naive stone
#

oh but it's surrounded by air, and then surrounded by other cubes, i see. damn

#

i have no idea how to solve this

#

lol

earnest forge
pine tiger
#

||if it's outside, you can BFS to the border||

naive stone
#

||i guess i can stop at the max x, y, and z coords from my scan||

pine tiger
pine tiger
naive stone
#

word word

flat sequoia
#

the coords are really small yeah

magic oxide
#

welp

#

my bfs is taking 5 years to run

#

how fun

torn thorn
#

fun

magic oxide
#

right my bfs is definitely broken

#

it's taking 5 years to fill out a 4x4x4 cube

torn thorn
#

are you sure you're checking if you've visted a square

magic oxide
#

yes

#

ok lemme just redo

devout tusk
#

||so, these are all the point sized cubes. what exactly needs to be done? i don't quite understand. do they need area of some connected 3d polygon?||

magic oxide
#

no

magic oxide
#

they aren't point sized

#

they're cube sized

torn thorn
#

||it's literally just minecraft||

magic oxide
#

honestly

#

I should just download minecraft

#

load the points in

torn thorn
#

lmao

magic oxide
#

and count with spectator mode

torn thorn
#

bro

#

😭

magic oxide
#

why tf is my bfs stupid

devout tusk
#

never played it πŸ€”

magic oxide
#

am I that incompetent I can't even write a correct bfs

torn thorn
#

||do a floodfill||

magic oxide
#

||I mean floodfill not bfs||

#

||same thing tho||

torn thorn
#

||don't try to go for sides, coordinates are small enough||

#

||are you checking your bounds correctly||

magic oxide
#

||it shouldn't matter right||

#

||I just have 0<=x<=20 for all the coords||

torn thorn
magic oxide
#

||my max coordinate seems to be twenty tho||

devout tusk
torn thorn
#

||i have this point||

naive stone
#

lol i had the stupidest bug

#

welp, that was fun

torn thorn
#

definitely not a saturday problem

#

should've switched with like day 16 or something

naive stone
#

he purposely makes puzzles on the weekend a little easier to give people a break

torn thorn
#

i thought it was the other way around .-.

#

people have more time to actually do the problem

naive stone
#

i did too actually, in the post where he mentions it, it's kinda ambiguous

#

who really knows what eric is thinking

torn thorn
#

πŸ€·β€β™‚οΈ

devout tusk
torn thorn
#

part 1 or part 2

#

@devout tusk

#

||assuming # is a solid and . is air, and we are on a 2d surface||

keen crystal
torn thorn
#

||part 1: each arrow is pointing to an exposed surface, count the amount of arrows||

torn thorn
keen crystal
#

hi

torn thorn
woven solar
torn thorn
#

lmao

torn thorn
naive stone
#

people have already used minecraft for visualizations of at least one of the previous puzzles. So I'm willing to bet we'll see more for today's

devout tusk
devout tusk
woven solar
#

||it is possible, yes, then that single-cube-droplet has a surface area of 6||

devout tusk
#

||that's just stupidly easy to be true||

devout tusk
#

but it's weekend...

#

sus

torn thorn
#

yeah

magic oxide
#

I just did ||+1 if not in set else -1 for every 6 directions of each block||

devout tusk
covert arrow
#

people have numbers >21?

torn thorn
#

yeah

devout tusk
#

||Is p2 convex hull or am I over thinking it?|| @torn thorn@covert arrow

modern harness
#

From the creator of AOC:

All of the puzzles are designed to have a solution that completes within 15 seconds on pretty old hardware in an interpreted language. (Call it ~250ms in a compiled language.)

Is it reasonable to have an expectation of 60x faster for compiled languages?

covert arrow
#

Yeah it seems similar actually no they're different

#

but you won't need it

placid lake
#

how was today’s problem

#

i glanced over it last night and it didn’t seem too bad

#

when i said i’d go to sleep instead of doing AoC for more sleep but

magic oxide
#

significantly easier compared to last 2 days

placid lake
#

nice

#

seemed so

mossy basin
#

will look at it soon

restive imp
#

I hate algorithms. Just like last year it's dijkstra that makes me lose my motivation

devout tusk
cyan sleet
#

there is no guarantee the shape you're trying to find the surface area of is convex

past comet
#

:sigh: I need more test inputs for day 16

#

I'm calculating something wrong somehow on the larger input because I pass the initial test, but past a certain branching factor all my searches return the same wrong answer

compact wasp
#

alas

past comet
#

huh, I had a bug in my time keeping for each player that wasn't breaking the test cases but was in the full scale

past comet
#

does the guess duration get longer than 5 minutes if you keep getting things wrong?

faint thicket
#

hey can anyone help me with day 7 im super duper stuck

#

a dm or even a quick call just to get myself situated because I cant seem to get anything down

torn thorn
faint thicket
sharp panther
#

!cban 989273658570711181 racism

marsh currentBOT
#

:incoming_envelope: :ok_hand: applied ban to @narrow hull permanently.

torn thorn
#

byee

modern terrace
#

last year day 19 was the hardest

#

now will it be?

magic oxide
#

what was last year 19?

covert arrow
#

beacons

#

the one where you had to rotate the scanner scans and match them up with beacon positions

magic oxide
#

oh that

#

hopefully not too difficult

#

don't have as much time to do AoC anymore

rancid creek
#

doesn't feel like day 19 was that bad, I enjoyed beacons.

magic oxide
#

beacons was mainly just brute force wasn't it?

#

just rotate everything 27 times and check every beacon for every scanner

rancid creek
#

day 23 and day 24 last year were both objectively harder. although day23 was good for me, it was on average a lot harder.

magic oxide
#

amphipods was such a simple problem and input

#

but devilishly annoying to solve if you didn't know algs or anything

#

think I ended up asking a comp sci professor friend of mine for help with an algorithm and he told me about uniform cost search

#

day 24 was just math

#

disguised as an instruction problem

rancid creek
#

really cool

modern terrace
magic oxide
#

think we're in the lull rn

#

so hopefully a less difficult problem today

#

and then difficulty ramps up again the next couple days

#

or of course the peaks are actually duplicating over the years and we get three peaks this year

earnest forge
#

GLHF everyone

#

Hopefully today won't be too long so I can get more sleep before my exam later kekw

#

My VSCode integrated terminal has kicked it, so always-on-top windows it is I guess πŸ™ƒ

covert arrow
#

GLHF

torn thorn
#

oh oop

#

i forgot

#

about

shut trellisBOT
torn thorn
#

ew what is this

#

||is this more dp||

magic oxide
#

lmao

#

is this like a game

torn thorn
#

πŸ€·β€β™‚οΈ

#

my brain is frazzled af rn

magic oxide
#

tech tree is ore -> clay -> obsidian

torn thorn
#

wow

magic oxide
#

i assume part 2 would be like ||now u can switch blueprints||

torn thorn
#

oh god

#

please no

magic oxide
#

tfw you have to reformat the example input

pine tiger
#

so

#

can you

#

build multiple

#

robots

#

in the same minutes?

torn thorn
#

probably...?

#

i doubt you'd ever want to thoug

#

||interesting how ore is collected only at the end of the day||

raven wave
#

im not having a good time

torn thorn
lunar jackal
#

I can't tell if it's a greedy algorithm or a dp problem

magic oxide
#

so you get the ores after the minute ends?

earnest forge
#

I can't figure out applying either of those lol

torn thorn
#

im trying dp

#

but like

lunar jackal
#

I'm sure the || obsidian to geode || is greedy

devout tusk
pine tiger
lunar jackal
#

screw it, dp it is

earnest forge
#

how do we apply dp to this though

#

genuinely please tell me I have no idea

lunar jackal
#

|| treat it like a graph ||

woven solar
# earnest forge ~~how do we apply dp to this though~~

50%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ | 1/2 [01:38<01:38, 98.94s/it]

very slowly

pine tiger
#

is this actual input

woven solar
#

nope, test

pine tiger
#

lmao

devout tusk
#

They should allow a user rating for every question so more questions can be made that are interesting rather than tedious like these

pine tiger
#

ok but

#

idek the algo for this

modern terrace
#

wtf i forgot

torn thorn
pine tiger
torn thorn
#

||just hail mary and hope then?||

dim pivot
#

i have no idea how tf to do this

modern terrace
modern terrace
torn thorn
#

tedious is just annoying

dim pivot
#

the dp does not work

raven wave
#

it makes sense its just

#

a lot to account for or do by yourself

torn thorn
#

latter days should be hard not tedious

woven solar
#

oh hey, test works

raven wave
#

both work for me im just bored

torn thorn
#

wow

pine tiger
torn thorn
woven solar
#

03:32 to check the test

pine tiger
#

bruh this has been running for so long

torn thorn
pine tiger
torn thorn
#

inputs have 30

#

so like mabe 40 minutes to finish 🧌

woven solar
#

weirdly enough, the actual input seems to go faster

#

tqdm predicts 4 minutes, but I'm sceptical

torn thorn
#

uhoh

woven solar
magic oxide
#

ok note to self don't set recursion limit to 999999999

compact wasp
#

and you account for being able to build multiple?

magic oxide
#

my python just crashed

woven solar
#

oh yikes, updated prediciton
| 4/30 [02:02<18:26, 42.56s/it]

modern harness
compact wasp
woven solar
#

the text of the tast actually seems unclear on that

compact wasp
#

wasn't reading carefully

woven solar
#

but I assume the fact we have only one factory is supposed to imply that

raven wave
#

I think one at a time

compact wasp
#

πŸ‘

modern terrace
compact wasp
#

wasn't reading, was about to do something much more tedious than needed

modern terrace