subject

The Cookie Game Riley and Morgan play the following cookie game. Given is one set of n red cookies and another set of m green cookies. At every turn, a player must eat two cookies from one set and one cookie from the other set (i. e., either (i) two green cookies and one red cookie, or (ii) two red cookie sand one green cookie). The player who cannot move loses. Assuming Riley will begin the game, which player will win?
Write an efficient dynamic programming algorithm in pseudo-code that decides whether a winning strategy for one of the players exists, give a brief justification of the correctness of your algorithm, and analyze its runtime.
Your algorithm’s input parameters should include n, m∈N0 representing the given numbers of green and red cookies, respectively. As output, the algorithm should state whether Riley or Moran will win, or if there is no winning strategy for either player.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 12:30
What characteristic of long period comets suggest they come directly from the oort cloud?
Answers: 2
question
Computers and Technology, 22.06.2019 20:00
Awide variety of “ apps “ are available to customize devices. which category of app does the word processing software fall into?
Answers: 2
question
Computers and Technology, 23.06.2019 08:30
Based on your knowledge of a good network, describe what you think is a perfect network would be. what kind of information and resources could users share on this network. what would the network administrator do? what kind of communication would be used?
Answers: 1
question
Computers and Technology, 24.06.2019 11:30
Why is body language an important factor in a business meeting
Answers: 1
You know the right answer?
The Cookie Game Riley and Morgan play the following cookie game. Given is one set of n red cookies...
Questions
question
Mathematics, 11.02.2021 14:00
question
Biology, 11.02.2021 14:00
question
Mathematics, 11.02.2021 14:00
question
Chemistry, 11.02.2021 14:00
Questions on the website: 13722361