# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1270738 | SmuggingSpun | Pismo (COCI18_pismo) | C++20 | 7 ms | 584 KiB |
#include<bits/stdc++.h>
#define taskname "B"
using namespace std;
template<class T>void minimize(T& a, T b){
if(a > b){
a = b;
}
}
int main(){
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
if(fopen(taskname".inp", "r")){
freopen(taskname".inp", "r", stdin);
}
int n, ans = INT_MAX;
cin >> n;
vector<int>a(n);
for(int& x : a){
cin >> x;
}
for(int i = 1; i < n; i++){
minimize(ans, abs(a[i] - a[i - 1]));
}
cout << ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |