# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1108482 | toast12 | Hindeks (COCI17_hindeks) | C++14 | 92 ms | 4344 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;
const int MAXA = 1e6;
int main() {
int n;
cin >> n;
vector<int> freq(MAXA+1);
for (int i = 0; i < n; i++) {
int x;
cin >> x;
freq[x]++;
}
int cur = 0;
for (int i = MAXA; i >= 0; i--) {
if (cur+freq[i] >= i) {
cout << i << '\n';
return 0;
}
cur += freq[i];
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |