145492025-01-15 07:43:23TortelliniJrKártya (80 pont)cpp17Accepted 80/801ms508 KiB
#include <iostream>
#include <vector>
using namespace std;
int main()
{
    int n, m;
	m = 0;
    cin >> n;
	vector<int> v(n);
	vector<int> o(n); //TESÓ EZ O(N) ALGORITMUS BíZZ BENNEM TESÓ CSAK EGY BUSZJEGYRE TESÓ
	for (int i = 0; i < n; i++)
	{
		cin >> v[i];
		m += v[i];
	}
	if (m % n != 0)
	{
		cout << "NEM" << endl;
		int x = 0;
		while (x < m)
		{
			x += n;
		}
		cout << x - m;
		return 0;
	}
	cout << "IGEN" << endl;
	for (int i = 0; i < n; i++)
	{
		if (m/n < v[i])
		{
			cout << (v[i] - (m / n)) << " ";
		}
		else
		{
			cout << 0 << " ";
		}
	}
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/01ms316 KiB
2Accepted0/01ms316 KiB
3Accepted4/41ms316 KiB
4Accepted5/51ms508 KiB
5Accepted5/51ms316 KiB
6Accepted5/51ms316 KiB
7Accepted5/51ms316 KiB
8Accepted4/41ms508 KiB
9Accepted4/41ms316 KiB
10Accepted5/51ms316 KiB
11Accepted5/51ms324 KiB
12Accepted5/51ms404 KiB
13Accepted6/61ms316 KiB
14Accepted6/61ms316 KiB
15Accepted7/71ms316 KiB
16Accepted7/71ms316 KiB
17Accepted7/71ms316 KiB