70512023-12-28 23:45:34xxxHús sütés (75 pont)cpp17Accepted 75/7526ms4764 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	int n;
	cin >> n;
	vector<int> a(n);
	for(int i = 0; i < n; i++) {
        cin >> a[i];
	}

	sort(a.rbegin(), a.rend());


	int ans = 0;
	for(int i = 0; i < n; i++) {
        a[i] += i;
        ans = max(ans, a[i]);
	}

	cout << ans << endl;
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1832 KiB
2Accepted0/03ms2024 KiB
3Accepted0/014ms2540 KiB
4Accepted3/33ms2456 KiB
5Accepted3/33ms2568 KiB
6Accepted3/33ms2628 KiB
7Accepted3/33ms2624 KiB
8Accepted4/43ms2864 KiB
9Accepted4/43ms2988 KiB
10Accepted4/43ms3240 KiB
11Accepted4/43ms3172 KiB
12Accepted4/43ms3056 KiB
13Accepted4/426ms3744 KiB
14Accepted4/426ms3816 KiB
15Accepted5/525ms3744 KiB
16Accepted5/525ms3744 KiB
17Accepted5/526ms3996 KiB
18Accepted4/426ms4100 KiB
19Accepted4/426ms4060 KiB
20Accepted4/418ms4316 KiB
21Accepted4/419ms4528 KiB
22Accepted2/223ms4764 KiB
23Accepted2/213ms4728 KiB