답안 #884390

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
884390 2023-12-07T09:24:31 Z ElenaBM Hindeks (COCI17_hindeks) C++17
40 / 50
199 ms 2396 KB
#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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 3 ms 344 KB Output is correct
8 Correct 30 ms 828 KB Output is correct
9 Correct 199 ms 2396 KB Output is correct
10 Incorrect 84 ms 1368 KB Output isn't correct