1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
using namespace std; int n, w[100005]; int (){ scanf("%d", &n); for(int i = 0; i < n; ++i) scanf("%d", &w[i]); sort(w, w + n); int cnt = 0; for(int i = n - 1; i >= 0; --i){ if(cnt <= w[i]) cnt++; else break; } printf("%dn", cnt); return 0; }
|
近期评论