제출 #377232

#제출 시각아이디문제언어결과실행 시간메모리
377232marat0210Hindeks (COCI17_hindeks)C++14
25 / 50
1085 ms2668 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >>n; vector <int> a(n); for (int i = 0; i < n; ++i) { cin >>a[i]; } for (int i = n - 1; i >= 0; --i) { int cur = i + 1; int 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...