9302022-01-29 14:01:19JMMirkoHús sütés (75 pont)cpp11Accepted 75/7554ms9640 KiB
#include <bits/stdc++.h>
using namespace std;
int main() 
{

    int n, m=0;
    cin >> n;
        vector <int> v(n);
    for(int i=0;i<n;i++){
        cin >> v[i];

    }
    sort(v.rbegin(), v.rend());
    for(int i=0;i<n;i++){
        if(i+v[i]>m)m=i+v[i];
    }
    cout << m;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/02ms1772 KiB
2Accepted0/01ms1780 KiB
3Accepted0/020ms2436 KiB
4Accepted3/31ms2192 KiB
5Accepted3/31ms2196 KiB
6Accepted3/31ms2200 KiB
7Accepted3/31ms2208 KiB
8Accepted4/42ms2208 KiB
9Accepted4/41ms2212 KiB
10Accepted4/41ms2224 KiB
11Accepted4/41ms2224 KiB
12Accepted4/41ms2228 KiB
13Accepted4/439ms3608 KiB
14Accepted4/439ms4280 KiB
15Accepted5/539ms4968 KiB
16Accepted5/541ms5660 KiB
17Accepted5/541ms6344 KiB
18Accepted4/441ms7028 KiB
19Accepted4/454ms7700 KiB
20Accepted4/437ms8516 KiB
21Accepted4/428ms8916 KiB
22Accepted2/237ms9424 KiB
23Accepted2/216ms9640 KiB