113222024-08-08 14:16:07bzyHús sütés (75 pont)cpp17Accepted 75/7552ms1596 KiB
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin >> n;
	vector <int> A(n);
	for(int& a:A) cin>>a;
	sort(A.begin(),A.end());
	int l = A[0] + n-1;
	for(int i = 1;i<n;i++){
		l = max(l,A[i] + n-1-i);
	}
	cout<<l;
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms584 KiB
2Accepted0/03ms356 KiB
3Accepted0/027ms904 KiB
4Accepted3/33ms436 KiB
5Accepted3/33ms360 KiB
6Accepted3/33ms504 KiB
7Accepted3/33ms376 KiB
8Accepted4/43ms504 KiB
9Accepted4/43ms484 KiB
10Accepted4/43ms376 KiB
11Accepted4/43ms356 KiB
12Accepted4/43ms356 KiB
13Accepted4/450ms1448 KiB
14Accepted4/450ms1428 KiB
15Accepted5/550ms1508 KiB
16Accepted5/552ms1572 KiB
17Accepted5/550ms1412 KiB
18Accepted4/450ms1508 KiB
19Accepted4/450ms1508 KiB
20Accepted4/448ms1596 KiB
21Accepted4/435ms1144 KiB
22Accepted2/246ms1400 KiB
23Accepted2/223ms1144 KiB