# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1162275 | MinhKien | Gap (APIO16_gap) | C++20 | 0 ms | 0 KiB |
#include <iostream>
using namespace std;
const int N = 1e6 + 10;
int n;
long long a[N];
int main() {
cin.tie(nullptr);
cout.tie(nullptr);
ios_base::sync_with_stdio(false);
cin >> n;
long long ans = 0;
for (int i = 1; i <= n; ++i) {
cin >> a[i];
if (i > 1) ans = max(ans, a[i] - a[i - 1]);
}
cout << ans << "\n";
return 0;
}