Spaces:
Sleeping
Sleeping
Alice and Bob are playing a game. Initially, there are n cakes, with the i-th cake having a tastiness value of ai.Alice and Bob take turns eating them, with Alice starting first: In her turn, Alice chooses and eats any remaining cake whose tastiness is strictly greater than the maximum tastiness of any of the cakes she's eaten before that. Note that on the first turn, she can choose any cake. In his turn, Bob chooses any remaining cake and eats it. The game ends when the current player can't eat a suitable cake. Let x be the number of cakes that Alice ate. Then, Alice wants to maximize x, while Bob wants to minimize x.Find out how many cakes Alice will eat if both players play optimally. |