16812022-12-01 15:39:52sarminKövek (100 pont)cpp17Wrong answer 15/10026ms4896 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/03ms1816 KiB
2Wrong answer0/026ms2760 KiB
3Wrong answer0/52ms2256 KiB
4Wrong answer0/52ms2456 KiB
5Accepted5/52ms2708 KiB
6Accepted5/52ms2908 KiB
7Accepted5/52ms2932 KiB
8Wrong answer0/52ms2900 KiB
9Wrong answer0/72ms3024 KiB
10Wrong answer0/72ms3224 KiB
11Wrong answer0/82ms3344 KiB
12Wrong answer0/82ms3468 KiB
13Wrong answer0/83ms3560 KiB
14Wrong answer0/84ms3712 KiB
15Wrong answer0/89ms3896 KiB
16Wrong answer0/823ms4284 KiB
17Wrong answer0/826ms4896 KiB