118972024-11-16 18:18:08SRobHús sütés (75 pont)cpp11Runtime error 15/7532ms828 KiB

#include <iostream>;
using namespace std;

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

SubtaskSumTestVerdictTimeMemory
base15/75
1Accepted0/01ms748 KiB
2Accepted0/01ms568 KiB
3Runtime error0/02ms824 KiB
4Accepted3/31ms572 KiB
5Accepted3/31ms572 KiB
6Accepted3/31ms572 KiB
7Wrong answer0/31ms632 KiB
8Wrong answer0/41ms568 KiB
9Runtime error0/41ms824 KiB
10Runtime error0/41ms824 KiB
11Runtime error0/41ms824 KiB
12Runtime error0/41ms808 KiB
13Runtime error0/41ms824 KiB
14Runtime error0/41ms824 KiB
15Runtime error0/51ms824 KiB
16Runtime error0/51ms824 KiB
17Runtime error0/52ms824 KiB
18Runtime error0/41ms784 KiB
19Runtime error0/41ms824 KiB
20Runtime error0/41ms828 KiB
21Accepted4/425ms796 KiB
22Wrong answer0/232ms788 KiB
23Accepted2/217ms792 KiB