# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
97079 | karlopuh | Hindeks (COCI17_hindeks) | C++14 | 233 ms | 2500 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 <bits/stdc++.h>
using namespace std;
vector< int > cit;
int n;
int main(){
cin>>n;
for(int i=0;i<n;i++){
int broj;
cin>>broj;
cit.push_back(broj);
}
sort(cit.begin(),cit.end());
int rj = 0;
for(int i=1;i<cit.size();i++){
if(cit[cit.size()-i]>=i){
rj=i;
}else{
cout<<rj;
return 0;
}
}
cout<<rj;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |