# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
912715 |
2024-01-19T18:31:02 Z |
Acanikolic |
Pismo (COCI18_pismo) |
C++14 |
|
8 ms |
1116 KB |
#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define F first
#define S second
using namespace std;
const int N = 2e5 + 10;
const int inf = 1e18;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
vector<int>a(n + 1);
for(int i = 1; i <= n; i++) cin >> a[i];
int res = inf;
for(int i = 2; i <= n; i++) res = min(res,abs(a[i] - a[i - 1]));
cout << res;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
600 KB |
Output is correct |
5 |
Correct |
7 ms |
1116 KB |
Output is correct |
6 |
Correct |
8 ms |
1116 KB |
Output is correct |
7 |
Correct |
7 ms |
1116 KB |
Output is correct |