Submission #912715

#TimeUsernameProblemLanguageResultExecution timeMemory
912715AcanikolicPismo (COCI18_pismo)C++14
70 / 70
8 ms1116 KiB
#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 timeMemoryGrader output
Fetching results...