38052023-03-03 09:00:26DalmaKövek (100 pont)cpp17Wrong answer 86/10028ms5000 KiB
#include <iostream>

using namespace std;

int main()
{
    int kupacok;
    cin >> kupacok;
    int kovek[kupacok];
    int atlag=0;
    for (int i=0; i<kupacok; i++)
    {
        cin >> kovek[i];
        atlag=atlag+kovek[i];
    }
    atlag=atlag/kupacok;
    int lepesek=0;
    int dobozok=0;
    for (int i=0; i<kupacok; i++)
    {
        dobozok=dobozok+kovek[i];
        if (dobozok%atlag==0)
        {
            lepesek++;
            dobozok=0;
        }
    }
    cout << kupacok-lepesek << endl;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base86/100
1Accepted0/03ms1876 KiB
2Accepted0/028ms2892 KiB
3Accepted5/53ms2296 KiB
4Accepted5/52ms2540 KiB
5Accepted5/52ms2752 KiB
6Accepted5/52ms2932 KiB
7Accepted5/52ms3144 KiB
8Accepted5/53ms3384 KiB
9Wrong answer0/73ms3504 KiB
10Wrong answer0/73ms3716 KiB
11Accepted8/83ms4076 KiB
12Accepted8/83ms4016 KiB
13Accepted8/83ms4028 KiB
14Accepted8/84ms4312 KiB
15Accepted8/810ms4516 KiB
16Accepted8/824ms4832 KiB
17Accepted8/828ms5000 KiB