Dynamic programming problem characteristics

  1. count
  • How many ways are there to get to the bottom right
  • How many ways can I pick the sum of k numbers
  1. Find the maximum and minimum
  • The maximum numeric sum of the path from the upper left corner to the lower right corner
  • Maximum ascending subsequence length
  1. Beg existence
  • Stone game, whether the first hand will win
  • Can we pick k numbers such that the sum is sum

Dynamic programming problem solving steps

  1. Determine the state of
  • The last step in studying the optimal strategy
  • Subproblem
  1. Transfer equation
  • We get it directly from the subproblem definition
  1. Initial conditions and boundary cases
  • thoughtful
  1. Calculate the order
  • So let’s use what we did before

Common types of dynamic planning

  • Coordinates type
  • Sequence type
  • Divide the type
  • Interval type
  • Backpack type
  • Longest sequence type
  • Game type
  • comprehensive