# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
776968 | 2023-07-08T12:37:34 Z | blacktulip | Pismo (COCI18_pismo) | C++17 | 9 ms | 1492 KB |
#include <bits/stdc++.h> using namespace std; typedef long long lo; #define fi first #define se second #define endl "\n" #define pb push_back #define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define FOR for(int i=1;i<=n;i++) #define mid ((start+end)/2) #define ort ((bas+son)/2) const lo inf = 1000000000; const lo li = 500005; const lo mod = 1000000007; int n,m,a[li],k,flag,t; int cev; string s; vector<int> v; int main(void){ scanf("%d",&n); FOR scanf("%d",&a[i]); cev=abs(a[2]-a[1]); for(int i=3;i<=n;i++){ cev=min(cev,abs(a[i]-a[i-1])); } printf("%d\n",cev); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 312 KB | Output is correct |
3 | Correct | 1 ms | 340 KB | Output is correct |
4 | Correct | 1 ms | 340 KB | Output is correct |
5 | Correct | 9 ms | 1492 KB | Output is correct |
6 | Correct | 9 ms | 1484 KB | Output is correct |
7 | Correct | 8 ms | 1492 KB | Output is correct |