dplass (dplass) wrote in topcoder,

SRM 288


Didn't we just do a "maximum triangle area" problem?

Anyway, three nested loops, make sure they're either all the same, or all different, and then get the area.

What's that? How do you get the area in 3d? Aw crap.

Google points me to http://mathworld.wolfram.com/TriangleArea.html

So I calc the length of each side (in 3d), and screw it up, because I'm using an array instead of x,y,z. That'll teach me...

But I squeaked it out, in only 18 mins.


OEIS (http://www.research.att.com/~njas/sequences/index.html) gives me the formula right away but I didn't realize it was a "make change with fewest coins" problem for a little while.

I flailed SO much on this. I knew it was a DP - a really "easy" DP - but I just couldn't figure it out.

Google only pointed me at "simple" DP homework assignments, but no answers! :-(

Finally I found one, and pretty much pasted it into the arena.

Submitted, but then I notice the page I found insisted on having the coins go from largest to smallest, not the other way. I panic, reverse my loop, and resubmit, dang. Turns out I didn't have to.

Yet another DP/probability problem. I assume this is similar to KiloXMan (or whatever it was called - staticentropy you were the writer), plus the twist of calculating the actual probabilities. This is probably just another "layer" of calculations on top of the "find the best order in which to kill all thse enemies". Oh, also there's a graphing component too - how do all these three things interact?
  • Post a new comment


    default userpic

    Your IP address will be recorded