# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
97078 | karlopuh | Hindeks (COCI17_hindeks) | C++14 | 1079 ms | 5936 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++){
for(int j=cit.size()-1;j>=cit.size()-i;j--){
if(!(cit[j]>=i)){
cout<<rj;
return 0;
}
}
rj=i;
}
cout<<rj;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |