#include <bits/stdc++.h>
using namespace std;
#define int long long
#define OYY 1000000000005
#define faster ios_base::sync_with_stdio(false); cin.tie(NULL);
#define mid (start+end)/2
#define mod 1000000007
vector <int> v;
int32_t main(){
faster
int n;cin>>n;
int dizi[n];
for(int i=0;i<n;i++){
cin>>dizi[i];
if(i>0)v.push_back(abs(dizi[i]-dizi[i-1]));
}
sort(v.begin(),v.end());
cout<<v[0]<<'\n';
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
16 ms |
2164 KB |
Output is correct |
6 |
Correct |
15 ms |
2132 KB |
Output is correct |
7 |
Correct |
14 ms |
2128 KB |
Output is correct |