Submission #151300

#TimeUsernameProblemLanguageResultExecution timeMemory
151300Linca_RobertHindeks (COCI17_hindeks)C++14
50 / 50
320 ms2392 KiB
#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; }
#Verdict Execution timeMemoryGrader output
Fetching results...