[DP] chessboard segmentation

Topic source Click me to enter the ACwing official website to submit Title Description Put an 8 × The chessboard of 8 is divided as follows: cut off a rectangular chessboard from the original chessboard and make the rest also rectangular, and then continue to divide the rest. After cutting (n − 1) times, there are n rectangular c ...

Added by Randwulf on Fri, 18 Feb 2022 12:46:53 +0200

Knapsack problem

knapsack problem Given a group of items, each item has its own weight value. Within the limited weight, how can we choose to maximize the total value. Three kinds of backpacks 1. 01 backpack: each item can only be selected once 2. Complete backpack: there is no limit to the number of choices for each item 3. Multiple backpacks: each item ca ...

Added by christian_phpbeginner on Fri, 18 Feb 2022 10:56:02 +0200

[CF1498D] Bananas in a Microwave (DP)

Topic & Translation Problem solution although m m m is big, but n n n is very small, so the title allows us to O ( ...

Added by duny on Fri, 18 Feb 2022 04:00:30 +0200

CodeForces - 560E Gerald and Giant Chess dp + permutation and combination

Portal: https://codeforces.com/contest/560/problem/E meaning of the title to one individual n ∗ m of Chess disc ...

Added by ihenman on Thu, 17 Feb 2022 22:21:55 +0200

1858: [09NOIP improvement group] target Sudoku

[Title Description] Xiaocheng and Xiaohua are both good students who love mathematics. Recently, they have become addicted to Sudoku games. They want to compete with Sudoku. But ordinary Sudoku was too simple for them, so they asked Dr. Z for advice. Dr. Z took out his recently invented "target Sudoku" as the topic of the competit ...

Added by cvarma on Wed, 16 Feb 2022 09:57:06 +0200

[ACWing algorithm basic course]: Chapter 5 - dynamic programming

Knapsack problem ★★★ (1) 0-1 knapsack problem (1 for each item) Topic introduction sample input 4 5 1 2 2 4 3 4 4 5 output 8 [version 1] two dimensional state definition of 0-1 knapsack problem f[i][j]: select only the first I items with total volume < = Max of J State analysis (1) When the current backpack capacity is insuf ...

Added by dast on Tue, 15 Feb 2022 14:15:19 +0200

[CF559E]Gerald and Path

subject Portal to CF thinking Generally speaking, we will sort intervals. Because the interval is essentially a two-dimensional partial order relationship, sorting according to the endpoint can make a dimension orderly, which is equivalent to dimension reduction. In this question, the interval is not very fixed. But of the two possible rang ...

Added by $var on Tue, 15 Feb 2022 10:37:47 +0200

2019 Nanchang (Revisiting Classics)

Introduction It's very difficult. I'm aware of the gap in knowledge points again Knowledge points involved Shape pressure DP, thinking, combinatorial mathematics, DSU on Tree, line segment tree Link: 2019 Nanchang Regional subject C Give a large nonnegative integer n n ...

Added by jrodd32 on Mon, 14 Feb 2022 12:17:41 +0200

[classic example] binary tree recursive structure classic topic collection @ binary tree

Xiaobian has something to say: these topics are the understanding and application of the recursive traversal structure of binary tree, which are very classic topics. After doing a few steps, you will feel that at present, you can't run away from all the problems. Recursion is just to deal with the current node - it may be to do some oper ...

Added by auamy on Sun, 13 Feb 2022 14:22:02 +0200

Mathematics and simple DP

mathematical problem Example: the number you can't buy Xiao Ming opened a candy store. He is ingenious: wrap the fruit candy into two kinds: a bag of 4 and a bag of 7. Candy can't be unpacked. When a child comes to buy sugar, he uses these two kinds of packaging to combine. Of course, some candies cannot be combined, such as buying 10 can ...

Added by dfego on Sun, 13 Feb 2022 10:14:59 +0200