# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
96382 | DiegoGarcia | Pismo (COCI18_pismo) | C++11 | 20 ms | 1016 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define optimiza_io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
#define ft first
#define sd second
#define ll long long
#define ld long double
#define ull unsigned long long
#define INF 1E5
#define LINF 1E18
using namespace std;
const ll maxn = 1e5+3;
ll n, v[maxn], ans;
int main()
{
scanf("%lld",&n);
for( ll i=0; i<n; i++ ){
scanf("%lld",&v[i]);
}
ans = LINF;
for( ll i=0; i<n; i++ ){
if( i > 0 && v[i] >= v[i-1] )
ans = min( ans, v[i] - v[i-1] );
if( i < n-1 && v[i] >= v[i+1] )
ans = min( ans, v[i] - v[i+1] );
}
printf("%lld",ans);
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |