Submission #230426

# Submission time Handle Problem Language Result Execution time Memory
230426 2020-05-10T06:25:21 Z VEGAnn Pismo (COCI18_pismo) C++14
70 / 70
20 ms 768 KB
#include <bits/stdc++.h>
#define sz(x) ((int)x.size())
using namespace std;
const int oo = 2e9;
const int N = 100100;
int n, a[N];

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);

    cin >> n;

    for (int i = 0; i < n; i++)
        cin >> a[i];

    int ans = oo;

    for (int i = 1; i < n; i++)
        ans = min(ans, abs(a[i] - a[i - 1]));

    cout << ans;

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 4 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 5 ms 384 KB Output is correct
5 Correct 16 ms 768 KB Output is correct
6 Correct 20 ms 768 KB Output is correct
7 Correct 17 ms 640 KB Output is correct