118962024-11-16 18:15:15SRobHús sütés (75 pont)cpp11Runtime error 12/7525ms544 KiB

#include <iostream>;
using namespace std;

const int MaxN = 10000;
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
base12/75
1Accepted0/01ms508 KiB
2Accepted0/01ms512 KiB
3Runtime error0/01ms320 KiB
4Runtime error0/31ms320 KiB
5Accepted3/31ms320 KiB
6Accepted3/31ms320 KiB
7Wrong answer0/31ms320 KiB
8Runtime error0/41ms320 KiB
9Runtime error0/41ms320 KiB
10Runtime error0/41ms320 KiB
11Runtime error0/41ms544 KiB
12Runtime error0/41ms320 KiB
13Runtime error0/41ms320 KiB
14Runtime error0/41ms500 KiB
15Runtime error0/51ms320 KiB
16Runtime error0/51ms508 KiB
17Runtime error0/51ms320 KiB
18Runtime error0/41ms320 KiB
19Runtime error0/41ms320 KiB
20Runtime error0/41ms320 KiB
21Accepted4/425ms440 KiB
22Runtime error0/21ms320 KiB
23Accepted2/217ms320 KiB