Taxman 游戏:最大得分
Taxman
题目详情
黑板上写着 1..10。你每次选一个数,税官会拿走所有能整除该数的数。
你只能选择那些“仍至少有一个因子尚未被税官拿走”的数。直到没有可选数为止。若最后还有未被拿走的数,则税官把它们全部拿走。
你的得分是你选到的数之和。问:最优策略下你的最大得分是多少?
We start with the numbers on a board. You pick a number. The taxman then takes all the numbers that divide it evenly. We do this until there are no numbers left. However, you can only pick numbers that have at least one factor that hasn't been taken yet. If there are any unclaimed numbers at the end, the taxman takes them. Your score is the total of the numbers that you take. Following optimal strategy, what is your max possible score?
解析
最优选择序列可以达到拿到 ,总和为 40。
因此最大得分为 40。
Original Explanation
Notice that we can only take one prime off the board since all the primes are divisible only by and themselves. Thus for our first pick, let's choose (the largest prime on the board). The taxman then takes and the board becomes , , , , , , , and . We can't choose , , or since they are prime and don't have any more factors. We should never choose because we then can't take later. In this case, the best choice to take is since it is one of the larger numbers and only has one factor left (). Now the board becomes , , , , , and . Out of this set, is the only number with only one factor so let's take it. Now the taxman takes . The board is now , , , and . Now it doesn't matter what order we take and , the taxman will get and . Thus the numbers we have are , , , , and which gives you a score of and the taxman has , , , , which gives them a score of . You win with a score of !