# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
99377 | kimcoding | Pismo (COCI18_pismo) | C++17 | 18 ms | 1280 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <cstdio>
#include <cmath>
#define min(a,b) (a<b?a:b)
int n, pre, ans = 2e9;
int main() {
scanf("%d", &n);
for(int i=1,now;i<=n;i++){
scanf("%d", &now);
if (i != 1) ans = min(ans, abs(now - pre));
pre = now;
}
printf("%d\n", ans);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |