#include<bits/stdc++.h>
using namespace std;
int main()
{
int N,i,a[100010],E;
cin >> N;
for (i = 0; i < N; i++)
{
scanf("%d", &a[i]);
}
sort(a, a + N, less<int>());
E = N;
for (i = 0; i < N; i++)
{
if (a[i] > E)
{
break;
}
else
{
E--;
}
}
cout << E;
return 0;
}
原文地址:https://www.cnblogs.com/gaoyutao/p/12355534.html
时间: 2024-11-04 06:44:25