Div. 2 lev. 3
Main Idea: DP
Because the number of point points in a question cannot exceed 16, we can use an integer to represent the number of point I. For example, 101 indicates the 1st point.
Because the given two-dimensional points are not ordered, all their subsets must be considered when decomposing the problem.
Define OPT [2 ^ N] and N as the number of two-dimensional points.
OPT [I] is the optimal result of considering the two-dimensional points represented by I.
Then the optimal sub-structure:
Opt = minj {OPT [I-j] + Res [J]}
Res [J] is the cost of using a box to frame the two-dimensional points represented by J. The initial value OPT [0] = 0, and the other value is-1.
Tip:
Opt definition: OPT [1 <n];
For (INT I = 0; I <1 <n; I ++) // a two-dimensional vertex combination of I
For (Int J = 0; j <n; j ++) // vertex J
If (I> J) & 1) // The current combination contains the J Vertex
// Calculate res
Optimal sub-structure (traversing the subset of all vertices represented by I ):
For (INT I = 0; I <1 <n; I ++)
For (Int J = I; j> 0; j = (J-1) & I)