最后更新 这个题做得也不好,dp[n]尝试写了几下,不太对. 应该是类似于gem theory的题. 当只有1个硬币剩下的时候直接拿走,不BB. 剩俩的时候也都拿了.. dp[n]表示剩下多少个硬币. 轮到我们拿第i个硬币的时候,有2种情况: 我们拿这个 i . 对手选择拿1个,就是第i+1个,然后第i+ 2轮到我们,我们再决定. 对手选择拿2个,i+1和i+2, 然后i+3轮到我们. 我们拿这个i,再拿下一个i+1. 对手选择拿1个,就是第i+2, 然后i+3轮到我们. 对手选择拿2个,i+2…