Submission #66512

# Submission time Handle Problem Language Result Execution time Memory
66512 2018-08-11T09:08:40 Z KLPP Hindeks (COCI17_hindeks) C++14
50 / 50
266 ms 7476 KB
#include<iostream>
#include<vector>
#include<queue>
#include<algorithm>
#include<stdio.h>

using namespace std;

int main(){
	int n;
	cin>>n;
	int arr[n];
	for(int i=0;i<n;i++)cin>>arr[i];
	sort(arr,arr+n);
	int h=0;
	for(int i=n-1;i>-1;i--){
		if(arr[i]>=n-i)h=n-i;
	}cout<<h<<endl;
	

	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 3 ms 248 KB Output is correct
2 Correct 2 ms 360 KB Output is correct
3 Correct 3 ms 472 KB Output is correct
4 Correct 3 ms 592 KB Output is correct
5 Correct 3 ms 596 KB Output is correct
6 Correct 4 ms 596 KB Output is correct
7 Correct 8 ms 708 KB Output is correct
8 Correct 46 ms 1704 KB Output is correct
9 Correct 266 ms 6744 KB Output is correct
10 Correct 134 ms 7476 KB Output is correct