善变的同学

cattle guest 之 fast hand

cattle guest 之 fast hand

cattle guest 之 fast hand

cattle guest 之 fast hand

最大m子段和

cattle guest 之 fast hand

  • dp[i][j]
    • 抽取ii段啊!!必须要抽ii
    • 抽取前jj个数
    • 必须包含第j项
  • dp[i][j] 有两可能 (取较大那个)

cattle guest 之 fast hand

案例

  • -2, 11,-4, 13,-5, 6,-2
  • 求子段数 1.2.3…7时的结果。
  • 开二维数组,d [ M+1 ] [N + 1],初始化全0
    • M 是子段数,N是原始数据的长度

cattle guest 之 fast hand

  • 沃特玛声明一个dp[M+1][N]
    • 行我只用1,2.。。。M
    • 列我用0.1.。。。N-1

cattle guest 之 fast hand

cattle guest 之 fast hand

参考链接

相关文章:

  • 2022-01-05
  • 2021-11-21
  • 2021-07-16
  • 2021-06-26
  • 2021-10-01
  • 2021-07-27
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-13
  • 2021-06-05
  • 2021-09-12
  • 2021-11-12
  • 2022-01-02
  • 2021-10-28
  • 2021-07-25
相关资源
相似解决方案