#P2501. [HAOI2006] 数字序列
[HAOI2006] 数字序列
Description
You are given an integer sequence of length . It does not look good, so we want to turn it into a strictly increasing sequence. However, we do not want to change too many elements, and we also do not want the magnitude of changes to be too large.
Input Format
The first line contains an integer , the length of the sequence.
The second line contains integers; the -th integer is the -th element of the sequence.
Output Format
On the first line, output an integer: the minimum number of elements that need to be changed.
On the second line, output an integer: under the condition that the number of changed elements is minimal, the minimum possible sum of absolute changes.
4
5 2 3 5
1
4
Hint
Constraints
- For of the testdata, it is guaranteed that .
- For of the testdata, it is guaranteed that , . The testdata guarantees that are generated at random.
Translated by ChatGPT 5
京公网安备 11011102002149号