# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
171629 | ToniB | Hindeks (COCI17_hindeks) | C++14 | 336 ms | 5752 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
}
if(i == n - 1){
sol = n;
}
}
cout << sol;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |