16832022-12-01 15:40:49sarminKövek (100 pont)cpp17Wrong answer 15/10026ms4644 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {

	int N;
	cin >> N;
	vector<int> K(N);
	int sum = 0;
	for (int i = 0; i < N; i++) {
		cin >> K[i];
		sum += K[i];
	}

	int allWill = sum / N, valami = 0;
	for (int i = 0; i < N-1; i++) {
		if (K[i] == 6 || K[i+1] == 6) continue;
		if (K[i] <= K[i+1] && K[i] != allWill) {
			K[i+1] -= allWill-K[i];
			K[i] = allWill;
		} else {
			K[i+1] += K[i]-allWill;
			K[i] = allWill;
		}
		valami++;
	}
	cout << valami;

	return 0;
}
SubtaskSumTestVerdictTimeMemory
base15/100
1Accepted0/03ms1812 KiB
2Wrong answer0/026ms2712 KiB
3Wrong answer0/52ms2208 KiB
4Wrong answer0/52ms2412 KiB
5Accepted5/52ms2616 KiB
6Accepted5/52ms2856 KiB
7Accepted5/52ms3064 KiB
8Wrong answer0/52ms3452 KiB
9Wrong answer0/72ms3356 KiB
10Wrong answer0/72ms3556 KiB
11Wrong answer0/82ms3544 KiB
12Wrong answer0/82ms3732 KiB
13Wrong answer0/83ms3824 KiB
14Wrong answer0/84ms3852 KiB
15Wrong answer0/89ms3996 KiB
16Wrong answer0/823ms4128 KiB
17Wrong answer0/826ms4644 KiB