HBC209393ElevenGame题解

初见你 算法基础篇 36 0
想要检验自己的编程水平?来试试全网最全C++题库,让您在挑战中不断进步。
Alice and Bob are playing a game. The rule is as follows:. '). And the string contains at least one question mark.Alice hopes the final score of this game is as large as possible, but Bob hopes the final score is as small as possible. Assume they both play the game with the best strategy, what's the final score of this game?

Alice and Bob are playing a game. The rule is as follows: 1. Initially, they are given a string consisted of digits '0' sim ∼ '9' and question marks ('?'). And the string contains at least one question mark. 2. Each player takes turn alternately. If the number of question marks is odd, the turns start with Alice. Otherwise, the turns start with Bob. 3. In each turn, the player can choose one of the question marks and change it to any digits ('0' sim ∼ '9') he/she likes. 4. The game ends when all question marks are changed to digits. 5. Assume the number represented by the final string is x. If x is a multiple of 11, the final score of this game is x. Otherwise, the final score of this game is -x. Alice hopes the final score of this game is as large as possible, but Bob hopes the final score is as small as possible. Assume they both play the game with the best strategy, what's the final score of this game?

HBC209393ElevenGame题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
不断学习,不断挑战,才能在编程领域中脱颖而出!全网最全C++题库,助您成为编程高手!

标签: HBC209393ElevenGame题解