# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
891711 | ind1v | Hindeks (COCI17_hindeks) | C++11 | 71 ms | 7668 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define sz(x) (int)((x).size())
#define all(x) (x).begin(), (x).end()
const int N = 5e5 + 4;
int a[N];
int n, h;
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n;
for (int i = 1; i <= n; ++i) {
cin >> a[i];
}
sort(a + 1, a + n + 1, greater<int>());
for (int i = 1; i <= n; ++i) {
if (a[i] >= i) {
h = i;
}
}
cout << h;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |