| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 377230 | marat0210 | Hindeks (COCI17_hindeks) | C++14 | 1059 ms | 5612 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;
int main()
{
    int n;
    cin >>n;
    vector <int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >>a[i];
    }
    for (int i = n - 1; i >= 0; --i) {
        int cur = i + 1;
        int cnt = 0;
        for (int j = 0; j < n; ++j) {
            if (a[j] >= cur) cnt++;
        }
        if (cnt == cur) {
            cout <<cur<<endl;
            return 0;
        }
    }
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
