69902023-12-23 23:05:37999Hús sütés (75 pont)cpp17Accepted 75/7548ms12264 KiB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
using namespace std;
#define int long long

struct evszam{
	int ev,ho,nap;
};


vector<int> hok {31,28,31,30,31,30,31,31,30,31,30,31};

int atvalt(evszam a){
	int cnt=0;
	for(int i = 1950;i<a.ev;i++){
		cnt+=365;
		if(i%4==0)cnt++;
	}
	for(int i = 0;i<a.ho;i++){
		cnt+=hok[i];
	}
	if(a.ho>2&&a.ev%4==0)cnt++;
	return cnt+a.nap;
}

signed main(){
	int n;cin>>n;
	vector<int> v(n);
	for(int i = 0;i<n;i++){
		cin>>v[i];
	}
	sort(v.rbegin(),v.rend());
	int ans=0;
	for(int i = 0;i<n;i++){
		ans=max(ans,v[i]+i);
	}cout<<ans<<endl;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1808 KiB
2Accepted0/03ms2064 KiB
3Accepted0/025ms3180 KiB
4Accepted3/33ms2708 KiB
5Accepted3/33ms3044 KiB
6Accepted3/33ms3092 KiB
7Accepted3/33ms3308 KiB
8Accepted4/43ms3392 KiB
9Accepted4/43ms3648 KiB
10Accepted4/43ms3644 KiB
11Accepted4/43ms3860 KiB
12Accepted4/43ms3892 KiB
13Accepted4/448ms5900 KiB
14Accepted4/448ms6580 KiB
15Accepted5/548ms7260 KiB
16Accepted5/548ms7944 KiB
17Accepted5/548ms8632 KiB
18Accepted4/448ms9464 KiB
19Accepted4/448ms10368 KiB
20Accepted4/445ms11184 KiB
21Accepted4/435ms11640 KiB
22Accepted2/243ms12140 KiB
23Accepted2/221ms12264 KiB