Submission #884390

#TimeUsernameProblemLanguageResultExecution timeMemory
884390ElenaBMHindeks (COCI17_hindeks)C++17
40 / 50
199 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()); if(v[n-1] == 0){ cout<< 0 << '\n'; return 0; } for (int i = 1; i <= n; ++i){ if (v[n-i] < i){ cout<< i-1 << '\n'; break; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...