답안 #96286

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
96286 2019-02-07T20:30:55 Z dalgerok Pismo (COCI18_pismo) C++14
70 / 70
17 ms 760 KB
#include<bits/stdc++.h>
using namespace std;



int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int n;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    int mn = 2e9;
    for(int i = 0; i + 1 < n; i++){
        mn = min(mn, abs(a[i] - a[i + 1]));
    }
    cout << mn;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 380 KB Output is correct
5 Correct 12 ms 632 KB Output is correct
6 Correct 17 ms 632 KB Output is correct
7 Correct 16 ms 760 KB Output is correct