70582023-12-29 08:30:28MagyarKendeSZLGKártya (80 pont)cpp17Accepted 80/803ms3996 KiB
#include <bits/stdc++.h>

#define speed cin.tie(0); ios::sync_with_stdio(0)
#define cinv(v) for (auto& e : v) cin >> e;
#define all(v) v.begin(), v.end()
#define has(s, e) s.count(e)

using namespace std;

int main() {
    speed;

    int N;
    cin >> N;
    vector<int> A(N);
    cinv(A);

    int sum = accumulate(all(A), 0);

    if (sum % N != 0) {
        cout << "NEM\n" << N - (sum % N);
    } else {
        cout << "IGEN\n";

        int avg = sum / N;

        for (int ax : A) {
            cout << (ax > avg ? ax - avg : 0) << ' ';
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms1828 KiB
2Accepted0/03ms2016 KiB
3Accepted4/43ms2228 KiB
4Accepted5/53ms2440 KiB
5Accepted5/53ms2652 KiB
6Accepted5/52ms2756 KiB
7Accepted5/53ms2872 KiB
8Accepted4/42ms2948 KiB
9Accepted4/43ms2956 KiB
10Accepted5/53ms2956 KiB
11Accepted5/53ms3084 KiB
12Accepted5/53ms3168 KiB
13Accepted6/63ms3168 KiB
14Accepted6/63ms3304 KiB
15Accepted7/73ms3384 KiB
16Accepted7/73ms3872 KiB
17Accepted7/73ms3996 KiB