Submission #147818

# Submission time Handle Problem Language Result Execution time Memory
147818 2019-08-30T18:57:31 Z mariadinca Hindeks (COCI17_hindeks) C++14
50 / 50
322 ms 5624 KB
#include <iostream>
#include <algorithm>

using namespace std;

int n, i, scor[500001], f[100001];

int main(){
    cin>>n;
    for(i=1;i<=n;i++){
        cin>>scor[i];
    }
    sort(scor+1, scor+n+1);
    for(i=n;i>=0;i--)
        if(scor[i] < n-i+1){
            cout<<n-i;
            return 0;
        }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 7 ms 376 KB Output is correct
8 Correct 60 ms 1272 KB Output is correct
9 Correct 322 ms 5624 KB Output is correct
10 Correct 162 ms 2936 KB Output is correct