49992023-04-08 17:26:09Laci3000Kövek (100 pont)cpp17Wrong answer 0/100228ms4752 KiB

#include <vector>
#include <iostream>

using namespace std;

int beolvasas(){
	int kupacok;
	cin >> kupacok;
	vector<int>lista(kupacok);
	int kovek_szama = 0;
	for (int i = 0; i < kupacok; i++)
	{
		cin >> lista[i];
		kovek_szama += lista[i];
	}


	cout << kovek_szama << endl;
	int celertek = kovek_szama / kupacok;
	cout << celertek << endl;
	int kulonbseg = 0;
	int a = 0;
	for (int i = 1; i < kupacok; i++)
	{
		if (lista[i - 1] != celertek) {
			kulonbseg = lista[i - 1] - celertek;
			cout << kulonbseg << endl;
			lista[i - 1] -= kulonbseg;
			lista[i] += kulonbseg;
			a++;
		}
		
	}
	return a;
}

int main()
{
	cout << beolvasas();
}

SubtaskSumTestVerdictTimeMemory
base0/100
1Wrong answer0/03ms1944 KiB
2Time limit exceeded0/0228ms2840 KiB
3Wrong answer0/53ms2352 KiB
4Wrong answer0/53ms2560 KiB
5Wrong answer0/53ms2800 KiB
6Wrong answer0/53ms2872 KiB
7Wrong answer0/53ms2888 KiB
8Wrong answer0/52ms2896 KiB
9Wrong answer0/72ms2928 KiB
10Wrong answer0/73ms3052 KiB
11Wrong answer0/83ms3132 KiB
12Wrong answer0/83ms3260 KiB
13Wrong answer0/88ms3492 KiB
14Wrong answer0/817ms3880 KiB
15Wrong answer0/852ms3980 KiB
16Wrong answer0/8119ms4372 KiB
17Wrong answer0/8192ms4752 KiB