답안 #377230

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
377230 2021-03-13T13:45:33 Z marat0210 Hindeks (COCI17_hindeks) C++14
20 / 50
1000 ms 5612 KB
#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;
        }
    }
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 512 KB Output isn't correct
2 Correct 1 ms 364 KB Output is correct
3 Incorrect 1 ms 364 KB Output isn't correct
4 Incorrect 1 ms 364 KB Output isn't correct
5 Correct 1 ms 364 KB Output is correct
6 Incorrect 2 ms 364 KB Output isn't correct
7 Correct 45 ms 364 KB Output is correct
8 Execution timed out 1059 ms 1260 KB Time limit exceeded
9 Execution timed out 1049 ms 5612 KB Time limit exceeded
10 Correct 83 ms 3072 KB Output is correct