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

运行 ID: 116986

# include <bits/stdc++.h> using namespace std ; int c [114514] ; int main ( ) { int a , e ; 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 ; }