Submission #884388

# Submission time Handle Problem Language Result Execution time Memory
884388 2023-12-07T09:19:15 Z ElenaBM Hindeks (COCI17_hindeks) C++17
40 / 50
162 ms 2396 KB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin>> n;
    vector<int>v(n);
    for (int i = 0; i < n; ++i)cin>> v[i];
    sort(v.begin(), v.end());
    if(v[n-1] == 0){
        cout<< 0 << '\n';
        return 0;
    }
    for (int i = 1; i <= n; ++i){
        if (v[n-i] >= i)continue;
        else{
            cout<< i-1 << '\n';
            return 0;
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 600 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 3 ms 348 KB Output is correct
8 Correct 31 ms 808 KB Output is correct
9 Correct 162 ms 2396 KB Output is correct
10 Incorrect 67 ms 1372 KB Output isn't correct