Submission #94872

# Submission time Handle Problem Language Result Execution time Memory
94872 2019-01-24T17:03:15 Z karlopuh Pismo (COCI18_pismo) C++14
0 / 70
1000 ms 1140 KB
#include <bits/stdc++.h>
using namespace std;

vector < pair<int,int> > niz; //min i max
int n,a,test;
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<<test;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Incorrect 2 ms 256 KB Output isn't correct
3 Incorrect 6 ms 376 KB Output isn't correct
4 Incorrect 6 ms 376 KB Output isn't correct
5 Execution timed out 1084 ms 1064 KB Time limit exceeded
6 Execution timed out 1066 ms 1000 KB Time limit exceeded
7 Execution timed out 1079 ms 1140 KB Time limit exceeded