# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
167250 | sans | Hindeks (COCI17_hindeks) | C++14 | 140 ms | 2296 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 <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
int main(int argc, char **argv){
int N; scanf("%d", &N);
vector<int> h(N); for(auto &x: h) scanf("%d", &x);
sort(h.begin(), h.end());
for(int i = h.back(); i >= 0; --i){
auto itr = lower_bound(h.begin(), h.end(), i);
if(h.end() - itr >= i){ printf("%d\n", i); break; }
}
return 0;
}
//cikisir
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |