// learn from https://discuss.leetcode.com/topic/6912/c-dp-solution
'''
class Solution {
public:
int calculateMinimumHP(vector<vector<int>>& dungeon) {
int m = dungeon.size(),n = dungeon[].size();
vector<vector<int> >dp(m+,vector<int>(n+,INT_MAX));
dp[m-][n] =;
dp[m][n-] = ;
for(int i = m-;i>=;i--){
for(int j = n-;j>=;j--){
dp[i][j] = min(dp[i][j+],dp[i+][j]) - dungeon[i][j];
dp[i][j] = max(dp[i][j],);
}
}
return dp[][];
}
};
'''
相关文章
- 03-25leetcode174. Dungeon Game
- 03-25292. Nim Game(C++)
- 03-25Nim Game
- 03-25The 2018 ICPC Asia Nanjing Regional J - Prime Game
- 03-25The Preliminary Contest for ICPC Asia Shanghai 2019 J. Stone game
- 03-25POJ 1773 Parity game 带权并查集
- 03-25Codeforces 388C Fox and Card Game (贪心博弈)
- 03-25POJ 1740 A New Stone Game(博弈)
- 03-25codeforces 1191 D-----轻松题解 --- Tokitsukaze, CSL and Stone Game #573 (Div. 2)
- 03-25POJ - 2505 A multiplication game