119032024-11-17 12:49:03SRobHús sütés (75 pont)cpp11Wrong answer 48/7546ms796 KiB

#include <iostream>;
#include <iterator>;
# include <algorithm>;
#include <array>;
using namespace std;

const int MaxN = 100000;
int main()
{
	int husdb;
	cin >> husdb;
	int sutok[MaxN] = {};
	int max = 0;
	for (int i = 1; i <= husdb; i++)
	{
		cin >> sutok[i-1];
	}
	sort(sutok,sutok + husdb);
	max = sutok[0] + husdb-1;
	for (int i = 1; i < husdb; i++)
	{
		if (sutok[i]+ (husdb-i-1) > max)
		{
			max = sutok[i]+ (husdb-i);
		}
			
	}
	cout << max;

}

SubtaskSumTestVerdictTimeMemory
base48/75
1Wrong answer0/01ms568 KiB
2Accepted0/01ms756 KiB
3Wrong answer0/023ms792 KiB
4Accepted3/31ms568 KiB
5Accepted3/31ms568 KiB
6Accepted3/31ms568 KiB
7Wrong answer0/31ms568 KiB
8Accepted4/41ms568 KiB
9Accepted4/41ms756 KiB
10Accepted4/41ms584 KiB
11Accepted4/42ms568 KiB
12Accepted4/41ms748 KiB
13Wrong answer0/445ms784 KiB
14Accepted4/446ms596 KiB
15Accepted5/545ms792 KiB
16Wrong answer0/545ms792 KiB
17Wrong answer0/546ms788 KiB
18Wrong answer0/446ms568 KiB
19Wrong answer0/445ms796 KiB
20Accepted4/441ms788 KiB
21Accepted4/432ms788 KiB
22Wrong answer0/241ms568 KiB
23Accepted2/219ms568 KiB