71462023-12-31 14:27:35xxxKártya (80 pont)cpp17Wrong answer 37/803ms3684 KiB
#include <bits/stdc++.h>
using namespace std;

void solve() {
    int n;
    cin >> n;
    vector<int> a(n);
    int sum = 0;
    for(int &i : a) {
        cin >> i;
        sum += i;
    }

    if ((sum / n) * n != sum) {
        cout << "NEM\n";
        cout << n - (sum % n) << '\n';
        return;
    }


    int OK = sum / n;
    for(int i : a) {
        if (i > OK) {
            cout << i - OK << ' ';
        } else {
            cout << 0 << ' ';
        }
    }

}

int main() {
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	int tt=1;
	//cin >> tt;
	while(tt--) {
        solve();
	}


	return 0;
}
SubtaskSumTestVerdictTimeMemory
base37/80
1Wrong answer0/03ms1828 KiB
2Accepted0/03ms2068 KiB
3Wrong answer0/43ms2292 KiB
4Accepted5/53ms2444 KiB
5Wrong answer0/53ms2656 KiB
6Accepted5/53ms3020 KiB
7Wrong answer0/53ms3088 KiB
8Accepted4/43ms3060 KiB
9Wrong answer0/43ms3164 KiB
10Accepted5/53ms3124 KiB
11Wrong answer0/53ms3252 KiB
12Accepted5/53ms3352 KiB
13Wrong answer0/63ms3364 KiB
14Accepted6/63ms3364 KiB
15Wrong answer0/73ms3492 KiB
16Accepted7/73ms3584 KiB
17Wrong answer0/73ms3684 KiB