Submission #75823

# Submission time Handle Problem Language Result Execution time Memory
75823 2018-09-11T08:29:19 Z charlies_moo Hindeks (COCI17_hindeks) C++
50 / 50
303 ms 7452 KB
#include <cstdio>
#include <iostream>
#include <algorithm>

using namespace std;

int n,a[500001],h;
bool flag=false;

bool cmp(int a,int b)
{
	return a>b;
}

int main()
{
	cin>>n;
	h=n;
	for(int i=0;i<n;i++)
		cin>>a[i];
	sort(a,a+n,cmp);
	for(int i=0;i<n;i++)
		if(a[i]<=i)
		{
			h=i;
			flag=true;
			break;
		}
	cout<<h;
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 496 KB Output is correct
4 Correct 2 ms 644 KB Output is correct
5 Correct 2 ms 652 KB Output is correct
6 Correct 2 ms 652 KB Output is correct
7 Correct 7 ms 652 KB Output is correct
8 Correct 49 ms 1740 KB Output is correct
9 Correct 303 ms 6652 KB Output is correct
10 Correct 128 ms 7452 KB Output is correct