Submission #104663

#TimeUsernameProblemLanguageResultExecution timeMemory
104663leonardaPismo (COCI18_pismo)C++14
70 / 70
15 ms1664 KiB
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
typedef pair<int, int> pi;
typedef long long int lint;
const int inf = 0x3f3f3f3f;
const int maxn = 1e5 + 5;

int n;
int a[maxn];
int d = inf;

int main ()
{
	ios::sync_with_stdio(0);
	
	cin >> n;
	for(int i = 0; i < n; ++i)
		cin >> a[i];
	
	for(int i = 1; i < n; ++i)
		if(abs(a[i] - a[i - 1]) < d)
			d = abs(a[i] - a[i - 1]);
	
	cout << d;

return 0;
}
//written and directed by pcelicamaja
#Verdict Execution timeMemoryGrader output
Fetching results...