95682024-02-23 10:29:45Pbg4444Hús sütés (75 pont)cpp17Accepted 75/7526ms11956 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);

    int n;
    cin>>n;
    vector<int> a(n);
    int min = 0;
    for(int i=0; i<n; i++){
        cin>>a[i];
    }
    sort(a.rbegin(), a.rend());
    for(int i=0; i<n; i++){
        min = max(min, a[i] + i);
        }
    cout<<min<<endl;
    }

SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1828 KiB
2Accepted0/03ms2052 KiB
3Accepted0/013ms2972 KiB
4Accepted3/33ms2808 KiB
5Accepted3/33ms3024 KiB
6Accepted3/33ms3124 KiB
7Accepted3/33ms3204 KiB
8Accepted4/43ms3332 KiB
9Accepted4/43ms3420 KiB
10Accepted4/43ms3516 KiB
11Accepted4/43ms3780 KiB
12Accepted4/43ms4016 KiB
13Accepted4/425ms5840 KiB
14Accepted4/425ms6256 KiB
15Accepted5/524ms6840 KiB
16Accepted5/525ms7528 KiB
17Accepted5/524ms8224 KiB
18Accepted4/425ms8928 KiB
19Accepted4/426ms9892 KiB
20Accepted4/417ms10672 KiB
21Accepted4/419ms11108 KiB
22Accepted2/223ms11620 KiB
23Accepted2/212ms11956 KiB