Given a natural number, which is divided into k parts, the sum of A1, a2..., requires A1 <= a2... how many types?
Principle: the integer n is split into the split score of the sum of the maximum number of m, and the split score of the n is equal to the split score of the maximum number of m. Based on this principle, the original problem is converted into the sum of the number of k splits and the maximum number of K-1 splits (or the original problem is converted into the number of k splits. sum with the maximum number of splits split into the K-1) f (n, k) = f (n, K-1) + f (n-k, k) can actually be seen as a complete backpack problem: items have k pieces: item, 1 item, 1, 1... item k: 1, 1 ,.., 1 (k) Why can we look at this? Because A1 <= A2 is required, although in ascending order, reverse release can also be seen as descending order, so... F [I, j] = f [i-1, j] + f [I, j-cost [I] but in fact cost [I] = I so: f [I, j] = f [i-1, j] + f [I, j-I]
Dynamic programming for integer splitting