#P4597. 序列 sequence
序列 sequence
Description
Given a sequence, in each operation you may add or to any number. Make the sequence non-decreasing.
Input Format
The first line contains an integer (), the number of elements.
The second line contains integers; the absolute value of each integer does not exceed .
Output Format
Output a single number: the minimal number of operations.
5
3 2 -1 2 11
4
5
2 1 1 1 1
1
Hint
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号