forked from wisdompeak/LeetCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2cb45c8
commit c279501
Showing
1 changed file
with
5 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
### 1510.Stone-Game-IV | ||
|
||
很显然的决策问题。假设dp[n]表示我方手头数字是n时能否胜利。那么遍历自己的决策(减去某个平方数),将剩下的数字(假设是m)转移给对手。一旦对手处理的数字m最终得到的结果是失败,那么说明我方肯定能赢。如果无论什么m,对手都能处理成功,那么说明我方肯定输。 | ||
|
||
本题的递归和DP写法都很好写。 |