#include <bits/stdc++.h>
using namespace std;
int N, n, mn = 2000000009, m;
int main()
{
cin >> N;
for(int i = 0; i < N; i++)
{
cin >> n;
if(i) mn = min(mn, abs(n - m));
m = n;
}
printf("%d\n", mn);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
5 ms |
256 KB |
Output is correct |
3 |
Correct |
6 ms |
256 KB |
Output is correct |
4 |
Correct |
6 ms |
256 KB |
Output is correct |
5 |
Correct |
60 ms |
376 KB |
Output is correct |
6 |
Correct |
63 ms |
376 KB |
Output is correct |
7 |
Correct |
59 ms |
256 KB |
Output is correct |