31082023-02-15 18:24:05horvathabelHús sütés (75 pont)cpp17Accepted 75/7554ms6004 KiB
#include <bits/stdc++.h>
using namespace std;
int main() {
	int n;
	cin>>n;
	priority_queue<int> q; 

	for (int i=0; i<n;i++){
		int x; 
		cin>>x;
		q.push(x);
	}
	int cnt=0; 
	int ans=q.top();
	q.pop();
	while (!q.empty()){
		cnt++;
		ans=max(ans, q.top()+cnt);
		q.pop();
	}
	cout<<ans; 
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1684 KiB
2Accepted0/03ms1856 KiB
3Accepted0/028ms2712 KiB
4Accepted3/33ms2580 KiB
5Accepted3/33ms2540 KiB
6Accepted3/33ms2752 KiB
7Accepted3/33ms2992 KiB
8Accepted4/43ms3228 KiB
9Accepted4/43ms3312 KiB
10Accepted4/43ms3376 KiB
11Accepted4/43ms3748 KiB
12Accepted4/43ms3700 KiB
13Accepted4/454ms4988 KiB
14Accepted4/454ms5196 KiB
15Accepted5/554ms5336 KiB
16Accepted5/554ms5416 KiB
17Accepted5/554ms5504 KiB
18Accepted4/454ms5640 KiB
19Accepted4/454ms5672 KiB
20Accepted4/445ms5776 KiB
21Accepted4/441ms5860 KiB
22Accepted2/254ms6004 KiB
23Accepted2/223ms5960 KiB