# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
176089 | Doda | Pismo (COCI18_pismo) | C++14 | 16 ms | 1016 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;
long long n,a[100005],raz,najz=1000000001;
int main () {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n;
cin >> a[0];
for (int i = 1;i<n;i++){
cin >> a[i];
if (a[i] < a[i-1])
raz = a[i-1]-a[i];
if (a[i] > a[i-1])
raz = a[i]-a[i-1];
if (raz < najz)
najz = raz;
}
cout << najz;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |