#include <iostream>
#include <algorithm>
using namespace std;
int n,v[500100];
int main(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>v[i];
}
sort(v+1,v+n+1);
for(int i=n;i>=1;i--){
if(n-i>v[i]){
cout<<n-i;
return 0;
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
380 KB |
Output isn't correct |
3 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
456 KB |
Output isn't correct |
5 |
Correct |
2 ms |
256 KB |
Output is correct |
6 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
7 |
Correct |
8 ms |
376 KB |
Output is correct |
8 |
Correct |
60 ms |
1272 KB |
Output is correct |
9 |
Incorrect |
319 ms |
5740 KB |
Output isn't correct |
10 |
Incorrect |
164 ms |
2936 KB |
Output isn't correct |