# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
143942 | 44442 | Hindeks (COCI17_hindeks) | C++11 | 124 ms | 5792 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;
int n,a[500004],ok;
int main (){
ios::sync_with_stdio(0);
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("\n%d",&a[i]);
}
sort(a,a+n);
int j=n-1;
while(j>-1 and ok+1<=a[j]){
ok++;
j--;
}
printf("%d",ok);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |