121962024-12-08 14:04:41SRobÚthasználati díj (75 pont)cpp17Wrong answer 20/7518ms588 KiB
// uthasznalat.cpp : Defines the entry point for the console application.
//


#include <iostream>

using namespace std;


int main()
{
	int varosDb, K;
	cin >> varosDb >> K;
	int seged;
	int egyDb = 0;
	for (int i = 0; i < varosDb; i++)
	{
		cin >> seged;
		if (seged== 1)
		{
			egyDb++;
		}
	}

	int megoldas = 0;
	if (egyDb >1)
	{
		megoldas = (egyDb-K+1)*(K-1)+(K*K/2 - K);
	}
	else
	{
		megoldas = 0;
	}
	
	cout << megoldas;	
}

SubtaskSumTestVerdictTimeMemory
base20/75
1Accepted0/01ms320 KiB
2Accepted0/01ms320 KiB
3Wrong answer0/018ms320 KiB
4Accepted5/51ms320 KiB
5Accepted5/51ms320 KiB
6Accepted5/51ms320 KiB
7Accepted5/51ms320 KiB
8Wrong answer0/51ms588 KiB
9Wrong answer0/51ms320 KiB
10Wrong answer0/51ms320 KiB
11Wrong answer0/51ms320 KiB
12Wrong answer0/51ms508 KiB
13Wrong answer0/51ms320 KiB
14Wrong answer0/517ms320 KiB
15Wrong answer0/517ms404 KiB
16Wrong answer0/517ms400 KiB
17Wrong answer0/517ms404 KiB
18Wrong answer0/517ms508 KiB