182922025-10-17 20:50:59brownwolfKövek (100 pont)python3Accepted 100/100127ms10508 KiB
# Kövek
# NT 2020 1. kat, 2. ford, 1. feladat
# 2025.10.17 FCs

n=int(input())
x=list()
x=input().split()
s=0
m=0
for i in range(n):
    x[i]=int(x[i])
    s=s+x[i]
db=s/n
i=0
while i<n:
    # Mindkét esetben van következő
    # nem baj ha negatív, majd pótlódik
    if x[i]!=db:
        x[i+1]=x[i+1]+x[i]-db
        m=m+1
    i=i+1
print(m)


SubtaskSumTestVerdictTimeMemory
base100/100
1Accepted0/017ms3120 KiB
2Accepted0/0127ms10508 KiB
3Accepted5/517ms3132 KiB
4Accepted5/517ms3164 KiB
5Accepted5/516ms3100 KiB
6Accepted5/516ms3124 KiB
7Accepted5/516ms3124 KiB
8Accepted5/517ms3084 KiB
9Accepted7/716ms3032 KiB
10Accepted7/716ms2996 KiB
11Accepted8/816ms3124 KiB
12Accepted8/816ms3324 KiB
13Accepted8/818ms3344 KiB
14Accepted8/826ms3764 KiB
15Accepted8/852ms5960 KiB
16Accepted8/8116ms10440 KiB
17Accepted8/8120ms10492 KiB