# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
94917 | karlopuh | Pismo (COCI18_pismo) | C++14 | 1081 ms | 1780 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
vector < pair<long long int,long long int> > niz; //min i max
long long int n,a,test;
long long int mini=1e9;
int main(){
cin>>n;
for(int j=0;j<n;j++){
cin>>a;
niz.push_back(make_pair(a,a));
for(int i=0;i<j;i++){
if(niz[i].first > a)niz[i].first=a;
if(niz[i].second < a)niz[i].second=a;
test=niz[i].second-niz[i].first;
if(test<mini)mini=test;
}
}
cout<<mini;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |