# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
562121 | AGE | Pismo (COCI18_pismo) | C++14 | 36 ms | 1004 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<bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define int long long
using namespace std;
const int N=1e6,M=2e3,mod=1e9+7;
int a[N];
main()
{
int n;
cin>>n;
for(int i=0;i<n;i++)
cin>>a[i];
int ans=1e18;
for(int i=0;i<n-1;i++){
ans=min(ans,abs(a[i+1]-a[i]));
}
cout<<ans<<endl;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |