Diferente pentru utilizator/apocalypto intre reviziile #141 si #142

Nu exista diferente intre titluri.

Diferente intre continut:

zmeu2
 
This is a classic dynamic programming problem and, like most DP problems, is simple if and only if you "get" the induction piece. Additionally, getting full points required figuring out (or knowing) a nice trick for when you need to calculate the sums of lots of different ranges.
Reading the problem, it seems to be very clearly a DP problem. In particular, the fact that the line of coins is always a continuous subrange of the original line is a big clue, and that we should compute Bessie's optimal strategy on the range [i, j] (inclusive on both sides) in terms of smaller ranges. Suppose that s(i, j) is the sum of c[i], c[i+1], ..., c[j]. Let b(i, j) be the most that Bessie can win if she plays *first* on the subrange [i, j]. Then we see that

Nu exista diferente intre securitate.

Topicul de forum nu a fost schimbat.