9312022-01-29 14:44:28JMMirkoEgykorúak (75 pont)cpp11Wrong answer 0/754ms2484 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
base0/75
1Wrong answer0/02ms1740 KiB
2Wrong answer0/04ms1956 KiB
3Wrong answer0/51ms1952 KiB
4Wrong answer0/51ms1964 KiB
5Wrong answer0/51ms1960 KiB
6Wrong answer0/51ms1972 KiB
7Wrong answer0/51ms1968 KiB
8Wrong answer0/51ms1976 KiB
9Wrong answer0/51ms1976 KiB
10Wrong answer0/52ms1996 KiB
11Wrong answer0/51ms2024 KiB
12Wrong answer0/52ms2056 KiB
13Wrong answer0/52ms2092 KiB
14Wrong answer0/52ms2140 KiB
15Wrong answer0/53ms2196 KiB
16Wrong answer0/54ms2268 KiB
17Wrong answer0/54ms2484 KiB