Submission #377233

#TimeUsernameProblemLanguageResultExecution timeMemory
377233marat0210Hindeks (COCI17_hindeks)C++14
25 / 50
1061 ms4204 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >>n; vector <long long> a(n); for (int i = 0; i < n; ++i) { cin >>a[i]; } for (int i = n - 1; i >= 0; --i) { long long cur = i + 1; long long cnt = 0; for (int j = 0; j < n; ++j) { if (a[j] >= cur) cnt++; } if (cnt == cur) { cout <<cur<<endl; return 0; } } cout <<0<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...