Submission #236936

#TimeUsernameProblemLanguageResultExecution timeMemory
236936super_j6Pismo (COCI18_pismo)C++14
70 / 70
19 ms640 KiB
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
#define endl '\n'
#define ll long long
#define pi pair<int, int>
#define f first
#define s second

const int maxn = 100000;
int n;
int a[maxn];

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> n;
	
	int ret = 1000000000;
	for(int i = 0; i < n; i++){
		cin >> a[i];
		if(i) ret = min(ret, abs(a[i] - a[i - 1]));
	}
	
	cout << ret << endl;

	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...