Submission #171622

#TimeUsernameProblemLanguageResultExecution timeMemory
171622ToniBHindeks (COCI17_hindeks)C++14
40 / 50
338 ms5756 KiB
#include <iostream> #include <algorithm> #include <string> using namespace std; int cmp(int x, int y){ return x > y; } int main(){ int n; cin >> n; int sol = 0; int all[n] = {0}; for(int i = 0; i < n; ++i){ cin >> all[i]; } sort(all, all + n, cmp); for(int i = 0; i < n; ++i){ if(all[i] < i + 1){ sol = i; break; } } cout << sol; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...