17982022-12-03 18:44:16kdbKártya (80 pont)cpp11Accepted 80/803ms4040 KiB
#include <iostream>
#include <vector>
using namespace std;
int main()
{
    cin.tie(nullptr);
    cout.tie(nullptr);
    ios_base::sync_with_stdio(false);
    int n, s =0;
    cin >> n;
    vector<int>vec;
    for (size_t i = 0; i < n; i++)
    {
        int a;
        cin >> a;
        vec.push_back(a);
        s += a;
    }
    if (s % n == 0)
    {
        cout << "IGEN" << endl;
        for (int i : vec)
        {
            if (i > s / n) cout << i - s / n << " ";
            else cout << 0 << " ";
        }
    }
    else cout << "NEM" << endl << n - s % n << endl;
    return 0;
}
/*
6
2 7 6 3 4 2
-IGEN
-0 3 2 0 0 0
*/
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms1828 KiB
2Accepted0/02ms2060 KiB
3Accepted4/42ms2260 KiB
4Accepted5/52ms2468 KiB
5Accepted5/52ms2676 KiB
6Accepted5/52ms2856 KiB
7Accepted5/52ms2940 KiB
8Accepted4/42ms3064 KiB
9Accepted4/42ms3272 KiB
10Accepted5/52ms3352 KiB
11Accepted5/52ms3344 KiB
12Accepted5/52ms3432 KiB
13Accepted6/62ms3560 KiB
14Accepted6/62ms3760 KiB
15Accepted7/72ms3968 KiB
16Accepted7/72ms4032 KiB
17Accepted7/72ms4040 KiB