119022024-11-17 12:48:15SRobHús sütés (75 pont)cpp11Wrong answer 37/7546ms820 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) > max)
		{
			max = sutok[i]+ (husdb-i);
		}
			
	}
	cout << max;

}

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