提交时间:2023-12-21 13:34:58

运行 ID: 116988

# include <bits/stdc++.h> using namespace std ; int c [114514] ; int main ( ) { int a , e = 0 ; cin >> a ; for ( int i = 1 ; i <= a ; i ++ ) { cin >> c [i] ; } for ( int i = 1 ; i <= a ; i ++ ) { for ( int j = i + 1 ; j <= a ; j ++ ) { if ( c [j] > c [i] ) { e = e >= c [j] - c [i] ? e : c [j] - c [i] ; } } } cout << e << endl ; return 0 ; }