Dynamic Programming
Dynamic Programming (English: Dynamic programming, referred to as DP) is a kind of mathematics, management science, computer science, economics and bioinformatics for use in solving complex problems through the original problem into sub-problems of a relatively simple way method.
Dynamic programming is often suitable for overlapping sub-problems and optimal substructure nature of the problem, dynamic programming method is often far less than the time spent simple solution.
The basic idea behind dynamic programming is very simple. In general, the solution to a given problem, we need to understand its different parts (ie sub-problems), then according to the solution of a problem child to arrive at the solution of the original problem.
Usually very similar in many sub-problems, for only trying to solve the problem once for each child dynamic programming method, thereby reducing the amount of calculation: Once a solution to the problem of the stator has been calculated, it is memory storage, so next time you need the same sub-problems when the solution of the direct look-up table. In this approach the number of repeats questions about the size of the input was particularly useful when exponential growth.
Dynamic programming problem satisfies three important properties
Optimal substructure property: If the solution of the problem of sub-optimal solution to the problem is also included in the best, we say that the problem has structural sub-optimal (ie, meet the optimization principle). Sub-optimal structural properties of problem-solving dynamic programming algorithm provides an important clue.
Nature overlapping subproblems: overlap problem refers to proton not always new problems subproblems recursive algorithm with respect to a top-down problem solving, generated each time that some sub-problem will be repeated a plurality of times calculated. Dynamic programming algorithm is the use of the overlapping nature of this sub-problems, the calculation of each sub-problem only once, and then save the results in a table, when you need to calculate the sub-problem has been calculated again, just in a table simply look at the results, so as to obtain higher efficiency.
No after-effect: after the various stages lined up according to a certain order, for a given stage of a state, its previous status of each stage can not directly influence its future decisions, but only through this current state. In other words, each state is a complete summary of past history. This is no after-directional, also known as no after-effect.
DP & simple recursive
- HDU 2084-- number of simple recursive Tower []
- HDU 2044-- a small bee ... [recurrence]
- HDU 2018-- cow story [recurrence]
- HDU 2050-- fold line dividing plane [Recursive]
- UVA 10328 --- Coin Toss [DP & Tarsus]
- CodeForces 429B——Working out 【DP】
01 backpack
[01] Detailed backpack: https://blog.csdn.net/Q_1849805767/article/details/103230949
- HDU 2546-- Fanka [01] greedy backpack +
- UVA 624 - CD [01] backpack + print path
- UVA 562 - Dividing coins backpack balance [01]
- HDU 2955 - Robberies [01] backpack deformation
- POJ 2184 - Cow Exhibition [01 backpack, negative]
- HDU 2639 - Bone Collector II backpackers [01,] k-optimal solution
- HDU 3466 - Proud Merchants backpack + [01] ordering the elimination of after-effect
- HDU 2126 - Buy the souvenirs [01] the number of species backpack +
Full backpack
[Completely] Detailed backpack: https://blog.csdn.net/Q_1849805767/article/details/103231110
- HDU 1114 - Piggy-Bank [completely] backpack full of just &
- POJ 2063 - Investment [completely] backpack
Multiple backpack
- HDU 1059 - Dividing [Multiple backpack & binary Optimized]
- HDU 2191-- mourn the 512 victims of the earthquake compatriots - cherish, Thanksgiving life [multiple] backpack & binary Optimized
- POJ 2392 - Space Elevator [Multi-binary Optimized & backpack & greedy]
Packet backpack
- HDU 1712-- ACboy needs your help [packet] backpack
- POJ 1837 - Balance backpack [group]
- HDU 3033 - I love sneakers [packets] [backpack thorough analysis data modification conditions] &!
- [Group HDU 3211-- Washing Clothes & Backpacks & balanced division grouping 01 backpack]
Tree Backpack
- POJ 1155 --TETE tree [backpack]
- HDU 1011 - Starship Troopers [tree] backpack
- POJ 1947 - Rebuilding Roads tree [backpack]
- HDU 1561 - The more, The Better [Construction & virtual tree node backpack]
- HDU 4003 - Find Metal Mineral [DP & tree class tree modification backpack]
LIS
- HDU 1003 - Max Sum [and] the largest subsequence
- HDU 1087 - Super Jumping Jumping Jumping [longest-up sequencing and dynamic programming] &!!!
- POJ 1239-- Increasing Sequences [strictly increasing sequence]
LCS
- HDU 1503 - Advanced Fruits [LCS longest common subsequence & modification & restore path combined string]
- HDU 1159 - Common Subsequence [LCS longest common subsequence]
- UVA 111 - History Grading [LCS longest common subsequence]
- POJ 1080-- Human Gene Functions [LCS] deformation (Good question!)
DP range
- 51Nod 1021-- stone merge interval [DP]
- HDU 3506 - Monkey Party [section] Inequality and DP & quadrangular
- POJ 2955 - Brackets [section] DP
- POJ 1141 - Brackets Sequence printing path DP & interval []
- CodeForces 149D - Coloring Brackets [section DP & DFS & memory search] (good questions, difficult)
- POJ 1651 - Multiplication Puzzle interval [search] DP & Memory
- HDU 4745 - Two Rabbits [DP & longest interval palindromic sequence]
DP tree
- HDU 1520 - Anniversary party tree [DP]
- HDU 2196 - Computer tree [DP]
- POJ 1655 - [DP & gravity Tree Tree] Balancing Act
- POJ 1741 - Tree Tree [DP & dotted tree]
- POJ 3107 - [DP & gravity Tree Tree] Godfather
- POJ 2378 - Tree Cutting the DP & tree [Erase] & Tree gravity
- POJ 3140 - Contestants Division [the DP & tree & Erase & Tree Tree right point deformed gravity]
- POJ 2486 - Apple Tree tree [DP]