Submission #3055136


Source Code Expand

n = int(input())
a = list(map(int, input().split()))
ans = 0

M = max(a)
m = min(a)
while M > n - 1:
	Mi = a.index(M)
	div = M // n
	for i in range(n):
		if i == Mi:
			a[i] -= n * div
		else:
			a[i] += div
	ans += div
	M = max(a)
	m = min(a)

print(ans)

Submission Info

Submission Time
Task E - Decrease (Judge ver.)
User anagohirame
Language Python (3.4.3)
Score 600
Code Size 273 Byte
Status AC
Exec Time 530 ms
Memory 3188 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 600 / 600
Status
AC × 5
AC × 35
Set Name Test Cases
Sample example0, example1, example2, example3, example4
All example0, example1, example2, example3, example4, maxrand0, maxrand1, maxrand2, maxrand3, maxrand4, maxrand5, maxrand6, maxrand7, maxrand8, maxrand9, rand0, rand1, rand2, rand3, rand4, rand5, rand6, rand7, rand8, rand9, small0, small1, small2, small3, small4, small5, small6, small7, small8, small9
Case Name Status Exec Time Memory
example0 AC 17 ms 3064 KB
example1 AC 17 ms 3060 KB
example2 AC 17 ms 3064 KB
example3 AC 17 ms 3060 KB
example4 AC 21 ms 3064 KB
maxrand0 AC 17 ms 3064 KB
maxrand1 AC 530 ms 3064 KB
maxrand2 AC 17 ms 2940 KB
maxrand3 AC 457 ms 3064 KB
maxrand4 AC 18 ms 3060 KB
maxrand5 AC 462 ms 3060 KB
maxrand6 AC 18 ms 3188 KB
maxrand7 AC 448 ms 3064 KB
maxrand8 AC 19 ms 3060 KB
maxrand9 AC 416 ms 3060 KB
rand0 AC 19 ms 3060 KB
rand1 AC 61 ms 2940 KB
rand2 AC 108 ms 3064 KB
rand3 AC 133 ms 3064 KB
rand4 AC 50 ms 3064 KB
rand5 AC 44 ms 2940 KB
rand6 AC 31 ms 3064 KB
rand7 AC 287 ms 3060 KB
rand8 AC 26 ms 3064 KB
rand9 AC 63 ms 3060 KB
small0 AC 17 ms 3064 KB
small1 AC 18 ms 3060 KB
small2 AC 17 ms 3064 KB
small3 AC 17 ms 3064 KB
small4 AC 23 ms 3064 KB
small5 AC 26 ms 3064 KB
small6 AC 20 ms 3060 KB
small7 AC 17 ms 2940 KB
small8 AC 25 ms 3060 KB
small9 AC 28 ms 3060 KB