You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
#include <bits/stdc++.h>
|
|
|
|
|
using namespace std;
|
|
|
|
|
const int N = 1e6 + 10;//<2F>ⵥ<EFBFBD><E2B5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
int a[N];//ÿ<><C3BF><EFBFBD>ⵥ<EFBFBD><E2B5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
|
int n;
|
|
|
|
|
cin >> n;
|
|
|
|
|
for (int i = 1; i <= n; i++)
|
|
|
|
|
cin >> a[i];
|
|
|
|
|
sort(a + 1, a + 1 + n);
|
|
|
|
|
|
|
|
|
|
int h = 1;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F3A3ACB4>Ƚϵ<C8BD><CFB5>ⵥ<EFBFBD><E2B5A5>
|
|
|
|
|
for (int i = 1;;) { //ö<><C3B6>ÿһ<C3BF>죬<EFBFBD><ECA3AC><EFBFBD><EFBFBD>breakֹͣ
|
|
|
|
|
if (a[h] >= i) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߵ<EFBFBD>һ<EFBFBD><D2BB>
|
|
|
|
|
i++;
|
|
|
|
|
if (++h > n) {
|
|
|
|
|
cout << i - 1 << endl;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|