80762024-01-12 12:06:25ChickenHús sütés (75 pont)cpp17Accepted 75/7546ms4464 KiB
#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main() {
    int ossz=0;
    int n;
    cin>>n;
    int a[n];
    for(int i=0; i<n; i++) {
        cin>>a[i];
    }
    sort(a, a + n);
    int k=0;
    while(k<n-1) {
        if (a[k]>=a[k+1]) {
            a[k+1]=a[k]+1;
        }
        k++;
    }
    cout<<a[n-1];
return 0; }
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1872 KiB
2Accepted0/03ms2120 KiB
3Accepted0/024ms2804 KiB
4Accepted3/33ms2640 KiB
5Accepted3/33ms2656 KiB
6Accepted3/33ms2716 KiB
7Accepted3/33ms2844 KiB
8Accepted4/43ms3004 KiB
9Accepted4/43ms3140 KiB
10Accepted4/43ms3216 KiB
11Accepted4/43ms3244 KiB
12Accepted4/43ms3380 KiB
13Accepted4/446ms4264 KiB
14Accepted4/446ms4232 KiB
15Accepted5/545ms4236 KiB
16Accepted5/546ms4236 KiB
17Accepted5/546ms4464 KiB
18Accepted4/446ms4368 KiB
19Accepted4/446ms4372 KiB
20Accepted4/441ms4372 KiB
21Accepted4/432ms4368 KiB
22Accepted2/241ms4396 KiB
23Accepted2/220ms4376 KiB