Submission #884393

#TimeUsernameProblemLanguageResultExecution timeMemory
884393ElenaBMHindeks (COCI17_hindeks)C++17
50 / 50
157 ms2396 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>> n; vector<int>v(n); for (int i = 0; i < n; ++i)cin>> v[i]; sort(v.begin(), v.end()); for (int i = 1; i <= n; ++i){ if (v[n-i] < i){ cout<< i-1 << '\n'; return 0; } } cout<< n << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...