172222025-06-04 15:25:08XetoxinoKövek (100 pont)pypy3Time limit exceeded 27/100303ms31720 KiB
N = int(input())
B = [int(i) for i in input().split()]
sz = 0
for i in range(N):
    sz += B[i]
atlag = sz/N
db = 0
while max(B) != atlag:
    maxB,minB = B.index(max(B)),B.index(min(B))
    m = atlag-min(B)
    B[maxB] -= m
    B[minB] +=m
    db += 1
print(db)
    
    
SubtaskSumTestVerdictTimeMemory
base27/100
1Accepted0/043ms19464 KiB
2Time limit exceeded0/0289ms31700 KiB
3Accepted5/539ms19388 KiB
4Accepted5/539ms19428 KiB
5Wrong answer0/539ms19420 KiB
6Wrong answer0/543ms19432 KiB
7Accepted5/539ms19388 KiB
8Accepted5/543ms19448 KiB
9Accepted7/739ms19424 KiB
10Wrong answer0/748ms21468 KiB
11Wrong answer0/850ms21480 KiB
12Wrong answer0/856ms21736 KiB
13Time limit exceeded0/8298ms21960 KiB
14Time limit exceeded0/8277ms22232 KiB
15Time limit exceeded0/8303ms24324 KiB
16Time limit exceeded0/8303ms30548 KiB
17Time limit exceeded0/8282ms31720 KiB