#Day 13 Discussion

104 messages · Page 1 of 1 (latest)

stone belfry
#

umpkin

#

I have no idea how to do this one

#

Need to put my thinking cap on

#

The fact A and B cost a different amount messes me up

sharp stratus
#

I still need to do part 2 from yesterday. Found another edge case

#

Sounds like the bus stop problem from a couple of years ago

#

That was Chinese Remainder Theorem

#

Probably not though. The subreddit blew up xD

#

Math day today

vivid fractal
#

part 2

#

?

#

part 1 is easy

#

||just solve two simultaneous with Cramer||

#

||me when I use polar coords because I'm edgy||

stone belfry
vivid fractal
#

wait that actually worked??

#

actually used something from linear algebra

#

hint: ||stop thinking of it as a discrete math problem for a moment||

#

||idk why the problem is worded as it is when there's just one combination that will lead you to the answer||

#

||or infinite?||

#

oh god I was so wrong

#

wait was i though

#

thonk

#

no idea why this doesn't work

#

nvm i just mistyped the answer

#

LMAO that worked for part 2 as well

#

i might be a genius

soft bramble
#

Oh wow this looks hard

#

My initial idea is ||a regression|| but I'm just gonna get a local maxima and be fucked

soft bramble
#

Ok ||cramer's rule|| works for part one

#

I input the example result into the box instead of my input so I have to wait an entire minute

vivid fractal
#

lol my code gives a floating point result so i retyped it into the box and mistype

lilac nacelle
#

what is this

#

solving linear equations?

#

or am i missing something

#

(part 1)

lilac nacelle
#

@vivid fractal am i wrong 😭
why is there a minimum when theres only one possible solution

vivid fractal
#

ur supposed to use dp

#

i think

#

but do you need to?

#

different question

lilac nacelle
#

solving equatin worked for test example

vivid fractal
lilac nacelle
#

any reason it wouldnt work for full example?

#

getting too low

vivid fractal
#

the world is your cloyster

stone belfry
#

What about something like this
Button A: X+50, Y+5
Button B: X+10, Y+1
Prize: X=60, Y=6

lilac nacelle
#

bruh

bronze hazel
#

my matrix math is off somewhere

lilac nacelle
#

You estimate that each button would need to be pressed **no more than 100 times **to win a prize

#

is this a condition

stone belfry
#

I reaaaally don't like todays question

stone belfry
lilac nacelle
lilac nacelle
#

||nvm it was because i Floored instead of Round||

stone belfry
lilac nacelle
#

it worked for part 1.. should technically work for part 2 as well

#

wow it did

bronze hazel
#

afaik 2x2 systems of equations only have more than one answer when one equation can simplify to the other and then they have infinite solutions

lilac nacelle
#

yea

#

and that type of input doesnt seem to appear

#

so whats the with "minimum cost"

tardy hatch
#

trying to throw you off perhaps

lilac nacelle
#

thought i had a chance to use binary search finally

vivid fractal
#

but it could just be bait who know

normal sonnet
#

underline, emphasis, italics on nasty

bronze hazel
#

what was the intended way?

normal sonnet
bronze hazel
#

i just used integer division and checked the answer it spit out against the prize coordinates

#

not the most efficient way but it worked

normal sonnet
bronze hazel
#

i just built matrix and vec structs with methods for getting the determinant, inverting, and multiplication, it worked well enough but i had to apply the scalar division by the determinant last when using integers otherwise everything is 0

normal sonnet
unborn harness
#

basic ||arithmetics||, you just solve a ||system of 2 equations||
today i did my best time in 3 years

vivid fractal
#

i dont think its the intended way though

#

im pretty sure you can solve it entirely discretely with dynamic programming

bronze hazel
#

even part 2?

vivid fractal
#

not htinking about it

#

its like those other dynamic programming problems

#

idk abt part 2

#

pretty sure htose constraints exist for a reason

normal sonnet
#

or maybe the counting change one

bronze hazel
#

could you do something similar to the stones problem

#

or maybe similar to day 7

#

where you have 3 different operations to choose from at every step and they all might get you closer or farther from the goal, here you have two operations with a cost associated

#

idk how it would work on part 2 because its all unbounded

normal sonnet
#

idk man what do I look like a scientist or something

uneven whale
#

I'm doing it in typescript this year and just spend the afternoon trying to figure out why my calculation is so off and looking into how to handle || large numbers ||... well, then I noticed this.

#

makes me miss Go