# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
153838 | mirceaishere | Hindeks (COCI17_hindeks) | C++14 | 293 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>
using namespace std;
int n, i, x, f[500002], v[500002];
int main(){
cin>>n;
for(i=1; i<=n; i++){
cin>>x;
if(x>n){
x=n;
}
f[x]++;
}
for(i=n; i>=1; i--){
f[i]+=f[i+1];
if(f[i]>=i){
cout<<i;
return 0;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |