Submission #91873

# Submission time Handle Problem Language Result Execution time Memory
91873 2018-12-30T17:53:53 Z Ort Pismo (COCI18_pismo) C++11
70 / 70
14 ms 1016 KB
#include<iostream>
#include<vector>

using namespace std;

int main()
{
	cin.sync_with_stdio(0); cin.tie(0);
	cin.exceptions(cin.failbit);
	int n, sol = 1000000000;
	vector<int> a;
	cin >> n; int h;
	for(int i=0;i<n;i++) {
		cin >> h; a.push_back(h);
	}
	for(int i=1;i<n;i++) {
		sol = min(max(a[i],a[i-1])-min(a[i],a[i-1]),sol);
	}
	cout << sol;
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 13 ms 1016 KB Output is correct
6 Correct 14 ms 1016 KB Output is correct
7 Correct 12 ms 1016 KB Output is correct