# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
776609 | vjudge1 | Pismo (COCI18_pismo) | C++17 | 27 ms | 1104 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define lalala ios_base::sync_with_stdio(false);cin.tie(NULL);
//#define endl '\n'
#define ll long long
#define N 100005
ll int arr[N],seg[N*4],segment[N*4];
inline void minbuid(int x,int l,int r){
if(l>r)return;
if(l==r){seg[x]=arr[l];return;}
int m=(l+r)/2;
minbuid(x*2,l,m);minbuid(x*2+1,m+1,r);
seg[x]=min(seg[x*2],seg[x*2+1]);
}
inline void maxbuid(int x,int l,int r){
if(l>r)return;
if(l==r){segment[x]=arr[l];return;}
int m=(l+r)/2;
maxbuid(x*2,l,m);maxbuid(x*2+1,m+1,r);
segment[x]=min(segment[x*2],segment[x*2+1]);
}
int main(){
int n;cin>>n;
for(int i=0;i<n;i++)cin>>arr[i];
ll int cev=1000000000000000000;
for(int i=0;i<n-1;i++){
cev=min(cev,abs(arr[i]-arr[i+1]));
}
cout<<cev<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |