28812023-02-01 15:02:49KristófKártya (80 pont)cpp11Accepted 80/803ms3712 KiB
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >>n;
    int sum=0;
    int atlag;
    int k[n];
    for(int i=0;i<n;i++){
        cin>>k[i];
        sum=sum+k[i];
    }
    atlag=sum/n;
    if(sum%n==0){
        cout<<"IGEN"<<endl;
    }
    else{

        cout<<"NEM"<<endl<<n-sum%n;
        return 0;
    }

    for(int i=0;i<n;i++){
        if(k[i]-atlag>0){
            cout<<k[i]-atlag<<" ";
        }
        else
            cout<<0<<" ";
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms1872 KiB
2Accepted0/03ms2128 KiB
3Accepted4/42ms2208 KiB
4Accepted5/52ms2204 KiB
5Accepted5/53ms2344 KiB
6Accepted5/52ms2456 KiB
7Accepted5/53ms2696 KiB
8Accepted4/43ms2792 KiB
9Accepted4/43ms3008 KiB
10Accepted5/53ms3092 KiB
11Accepted5/53ms3220 KiB
12Accepted5/53ms3428 KiB
13Accepted6/63ms3620 KiB
14Accepted6/63ms3704 KiB
15Accepted7/73ms3708 KiB
16Accepted7/73ms3712 KiB
17Accepted7/73ms3708 KiB