# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
311177 | 2020-10-09T14:54:03 Z | phathnv | Pismo (COCI18_pismo) | C++11 | 20 ms | 1656 KB |
#include <bits/stdc++.h> #define mp make_pair #define X first #define Y second #define taskname "PISMO" using namespace std; typedef long long ll; typedef pair <int, int> ii; const int N = 1e5 + 1; const int INF = 2e9; int n, a[N]; void readInput(){ scanf("%d", &n); for(int i = 1; i <= n; i++) scanf("%d", &a[i]); } void solve(){ int res = INF; for(int i = 2; i <= n; i++) res = min(res, abs(a[i - 1] - a[i])); printf("%d", res); } int main(){ //freopen(taskname".inp", "r", stdin); //freopen(taskname".out", "w", stdout); readInput(); solve(); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 256 KB | Output is correct |
3 | Correct | 1 ms | 384 KB | Output is correct |
4 | Correct | 1 ms | 384 KB | Output is correct |
5 | Correct | 18 ms | 1536 KB | Output is correct |
6 | Correct | 20 ms | 1656 KB | Output is correct |
7 | Correct | 19 ms | 1536 KB | Output is correct |