50012023-04-08 19:10:46Laci3000Kártya (80 pont)cpp17Accepted 80/803ms3400 KiB

#include <iostream>
#include <vector>

using namespace std;

vector<int> beolvaso() {
    int x;
    cin >> x;
    vector<int> t(x);
    for (int i = 0; i < x; i++)
    {
        cin >> t[i];
    }

    return t;
}
void feldolgozas(vector<int> t) {
    int osszeg = 0;
    for (int i = 0; i < t.size(); i++)
    {
        osszeg += t[i];
    }
    int a = osszeg % t.size();
    if (a == 0) {

        cout << "IGEN" << endl;
        int b = osszeg / t.size();
        for (size_t c = 0; c <t.size(); c++)
        {
            if (t[c] - b < 0) {
                cout << 0;
                cout << " ";
            }
            else {
                cout << t[c] - b;
                cout << " ";
            }
        }

    }
    else {
        cout << "NEM" << endl;
        cout << t.size() - a;
    }
}
int main()
{
    vector<int> lista = beolvaso();
    feldolgozas(lista);
}

SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms1808 KiB
2Accepted0/03ms2004 KiB
3Accepted4/43ms2212 KiB
4Accepted5/53ms2432 KiB
5Accepted5/53ms2636 KiB
6Accepted5/53ms2852 KiB
7Accepted5/53ms3060 KiB
8Accepted4/42ms3152 KiB
9Accepted4/42ms3152 KiB
10Accepted5/53ms3160 KiB
11Accepted5/53ms3156 KiB
12Accepted5/53ms3172 KiB
13Accepted6/63ms3176 KiB
14Accepted6/63ms3300 KiB
15Accepted7/73ms3388 KiB
16Accepted7/73ms3388 KiB
17Accepted7/73ms3400 KiB