subject
Mathematics, 09.04.2021 02:00 kimmy6973

Smoov and Curly are playing a game. In this game, there is a stack of n bricks. The ith brick in the stack is worth v[i] points (where v[0] is the value of the top brick). The players take turns removing either 1 or 2 bricks from the top of the stack. The player that removes a brick earns the number of points associated with the brick. The game ends when all the bricks have been removed, and the winner is the player who has earned the most points. For example, if v = [1, 1, 3, 4] and Smoov is the first player to move, then Smoov's optimal strategy is to take just the first brick (earning 1 point). Curly's optimal strategy is then to take the next two bricks (earning 4 points). Smoov then finishes by taking the last brick (earning 4 more points). Therefore, the maximum score Smoov can earn is 5. Assume that Smoov takes the first turn and that both Smoov and Curly play optimally. Given the list v of the values of the bricks (all integers greaterthanorequalto 0), output the maximum score Smoov can earn.

Required:
a. Define the subproblems to be solved in English.
b. Define an appropriate recurrence for the subproblems.

ansver
Answers: 2

Other questions on the subject: Mathematics

image
Mathematics, 21.06.2019 17:00, valeriekbueno
100 points, hi, iā€™m not sure how to get the equation from the graph and table.
Answers: 2
image
Mathematics, 21.06.2019 20:50, thuzar
Write the equation in logarithmic form 8^x=64
Answers: 1
image
Mathematics, 22.06.2019 02:10, seonna
Find the amount of simple interest earned for depositing the given principle in an account if $2200 is invested at 5.5 % for 6 months
Answers: 2
image
Mathematics, 22.06.2019 04:00, myhomeacc32
Renee hiked for 6 3/4 miles. after resting, renee hiked back along the same route for 5 1/4 miles. how many more miles does renee need to hike to return to the place where she started? represent your answer as a simplified mixed number, if necessary.
Answers: 1
You know the right answer?
Smoov and Curly are playing a game. In this game, there is a stack of n bricks. The ith brick in the...

Questions in other subjects:

Konu
Health, 01.10.2021 23:20