#P5146. 最大差值
最大差值
Description
HKE has recently been keen on studying sequences, and once he discovered an interesting problem:
For a sequence , find two indices () such that is maximized.
Given this sequence, please find the maximum value of .
Input Format
The first line contains a positive integer . The next lines each contain one integer. The integer on the -th line is .
Output Format
One line, the maximum value of .
10
1
3
4
6
7
9
10
1
2
9
9
Hint
Constraints
- For of the testdata, .
- For of the testdata, .
- For of the testdata: , and is within the int range.
Translated by ChatGPT 5
京公网安备 11011102002149号