//10 9 8 8 7 7 6 6 3 2
#include<bits/stdc++.h>
using namespace std;
int a[1000000];
bool cmp(int a,int b){
return a>b;
}
int main() {
int n, e = 0;
cin>>n;
for(int i = 0; i < n; i++)
scanf("%d", &a[i]);
sort(a, a+n, cmp);
while(e < n && a[e] > e+1)
e++;
cout<<e<<endl;
return 0;
}
1117 Eddington Number (25 分)没读懂题,要求是大于不能等于
最新推荐文章于 2024-08-14 11:57:07 发布