Description
Given a length of N number of column A and we want an integer T. A into segments such that each segment 'check value' need not more than N. It requires at least several sections.
Sol
The first is the method for finding the check value:
To make 'squared differences of each pair of numbers' maximum sum, it is clear that the first order, and then taking the maximum and minimum as a pair, the second largest and second smallest as a pair .....
Conversion problem is then: It requires at least a partial number of stages, the left end point is obviously determined, under the premise of the checksum value does not exceed the right end point T is extended as much as possible.
Optimization extension lies right point, of course, is multiplied with hot qwq
There is the desire to optimize the value of the check: can not row almost every time, but the first row of the increase period, and then merge just fine
Code
Wa inf the times, reconstruction qwq tomorrow
Description
Given a length of N number of column A and we want an integer T. A into segments such that each segment 'check value' need not more than N. It requires at least several sections.
Sol
The first is the method for finding the check value:
To make 'squared differences of each pair of numbers' maximum sum, it is clear that the first order, and then taking the maximum and minimum as a pair, the second largest and second smallest as a pair .....
Conversion problem is then: It requires at least a partial number of stages, the left end point is obviously determined, under the premise of the checksum value does not exceed the right end point T is extended as much as possible.
Optimization extension lies right point, of course, is multiplied with hot qwq
There is the desire to optimize the value of the check: can not row almost every time, but the first row of the increase period, and then merge just fine
Code
Wa inf the times, reconstruction qwq tomorrow