#P7785. [COCI 2016/2017 #6] Hindeks
[COCI 2016/2017 #6] Hindeks
Description
Given a sequence, please find the largest integer such that in the original sequence there are at least numbers .
Input Format
The first line contains a positive integer , which denotes the number of elements in the sequence.
The second line contains integers , which denote the elements of the sequence.
Output Format
Output one line containing an integer , which is the largest integer that satisfies the condition.
5
1 1 4 8 1
2
5
8 5 3 4 10
4
Hint
Sample Explanation #1.
There are numbers greater than or equal to , namely and .
Sample Explanation #2.
There are numbers greater than or equal to , namely , , , and .
Constraints.
For of the testdata, , .
Notes.
The score of this problem follows the original COCI settings, with a full score of .
Translated from COCI2016_2017 CONTEST #6 T1 HINDEKS.
Translated by ChatGPT 5
京公网安备 11011102002149号