답안 #779091

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
779091 2023-07-11T07:43:22 Z 1075508020060209tc Pismo (COCI18_pismo) C++14
70 / 70
28 ms 1860 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define X first
#define Y second

int n;
int ar[2000006];

signed main(){
cin>>n;
for(int i=1;i<=n;i++){
    cin>>ar[i];
}
int ans=abs(ar[2]-ar[1]);
for(int i=3;i<=n;i++){
    ans=min(ans,abs(ar[i]-ar[i-1]));
}
cout<<ans<<endl;

}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 304 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 25 ms 1832 KB Output is correct
6 Correct 28 ms 1844 KB Output is correct
7 Correct 25 ms 1860 KB Output is correct