# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
151299 | 2019-09-02T12:02:42 Z | Linca_Robert | Hindeks (COCI17_hindeks) | C++14 | 0 ms | 0 KB |
#include<bits/stdc++.h> using namespace std; int N, arr[500005]; int main(){ cin >> N; for( int i = 1; i <= N; i++ ) cin >> arr[i]; sort( arr+ 1, arr + N + 1 ); for( int i = N; i >= 1; i-- ){ if( arr[i] < N - i + 1 ){ cout << N - i << endl; return 0 } } cout << N << endl; return 0; }