摘要: 题源:leetcode 链接:https://leetcode-cn.com/problems/pascals-triangle/ 数学方法这里不赘述,这里写一下动态规划的转移方程 dp[i][j] = dp[i-1][j-1] + dp[i-1][j] 阅读全文
posted @ 2021-07-26 19:48 Danae丶 阅读(23) 评论(0) 推荐(0)
摘要: 题源:leetcode 链接:https://leetcode-cn.com/problems/climbing-stairs/ 这也是道简单的动态规划题,状态转移方程为:f(x) = f(x-1)+f(x-2) 1 class Solution { 2 public: 3 int climbSta 阅读全文
posted @ 2021-07-26 11:01 Danae丶 阅读(48) 评论(0) 推荐(0)