답안 #884393

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
884393 2023-12-07T09:27:05 Z ElenaBM Hindeks (COCI17_hindeks) C++17
50 / 50
157 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());
    for (int i = 1; i <= n; ++i){
        if (v[n-i] < i){
            cout<< i-1 << '\n';
            return 0;
        }
    }
    cout<< n << '\n';
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 600 KB Output is 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 1 ms 348 KB Output is correct
7 Correct 2 ms 348 KB Output is correct
8 Correct 25 ms 820 KB Output is correct
9 Correct 157 ms 2396 KB Output is correct
10 Correct 68 ms 1400 KB Output is correct