133222025-01-07 14:04:36MezeiDavidKártya (80 pont)cpp17Accepted 80/801ms512 KiB
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n, osszeg = 0;
    cin >> n;
    vector<int> b(n);
    for(int i = 0; i < n; i++)
    {
        cin >> b[i];
        osszeg += b[i];
    }
    bool z;
    if(osszeg % n != 0)
    {
        cout << "NEM\n" << n - osszeg % n;
        z = 0;
    }
    else
    {
        cout << "IGEN\n";
        z = 1;
    }
    if(z)
    {
        int atlag = osszeg / n;
        for(int i = 0; i < n; i++)
        {
            if(b[i] > atlag)
                cout << b[i] - atlag << " ";
            else
                cout << 0 << " ";
        }
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/01ms316 KiB
2Accepted0/01ms316 KiB
3Accepted4/41ms316 KiB
4Accepted5/51ms316 KiB
5Accepted5/51ms316 KiB
6Accepted5/51ms512 KiB
7Accepted5/51ms368 KiB
8Accepted4/41ms316 KiB
9Accepted4/41ms316 KiB
10Accepted5/51ms316 KiB
11Accepted5/51ms316 KiB
12Accepted5/51ms316 KiB
13Accepted6/61ms316 KiB
14Accepted6/61ms316 KiB
15Accepted7/71ms376 KiB
16Accepted7/71ms316 KiB
17Accepted7/71ms316 KiB