12055 | 2024-11-26 15:59:32 | kochv | Pontos Átlag | python3 | Accepted 100/100 | 256ms | 26344 KiB |
N,K = map(int,input().strip().split())
P = list(map(int,input().strip().split()))
o1 = K*N
# print(o1)
o2 = sum(P)
# print("o2=",o2)
P.sort()
if o1 == o2:
print(str(0))
elif o1 >= o2:
print(str(1))
else:
i = -1
while o1 < o2:
# print("*")
# print("i=",i)
if P[i]> o2 - o1:
# print("**")
o2 = o1
else:
o2 = o2 - (P[i]-1)
# print("***")
# print("o2=",o2)
P[i] = 1
i -=1
# print(P)
print(str(-i))
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 16ms | 3128 KiB | ||||
2 | Accepted | 16ms | 3128 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 16ms | 3128 KiB | ||||
4 | Accepted | 16ms | 3124 KiB | ||||
5 | Accepted | 16ms | 3120 KiB | ||||
6 | Accepted | 16ms | 2872 KiB | ||||
7 | Accepted | 16ms | 3024 KiB | ||||
8 | Accepted | 17ms | 3056 KiB | ||||
9 | Accepted | 16ms | 2956 KiB | ||||
10 | Accepted | 16ms | 3012 KiB | ||||
11 | Accepted | 16ms | 3204 KiB | ||||
12 | Accepted | 16ms | 3108 KiB | ||||
13 | Accepted | 16ms | 3120 KiB | ||||
subtask3 | 40/40 | ||||||
14 | Accepted | 17ms | 3060 KiB | ||||
15 | Accepted | 17ms | 3124 KiB | ||||
16 | Accepted | 16ms | 3044 KiB | ||||
17 | Accepted | 16ms | 3056 KiB | ||||
18 | Accepted | 17ms | 3312 KiB | ||||
19 | Accepted | 17ms | 3124 KiB | ||||
20 | Accepted | 16ms | 3412 KiB | ||||
21 | Accepted | 17ms | 3128 KiB | ||||
22 | Accepted | 16ms | 3056 KiB | ||||
23 | Accepted | 16ms | 2992 KiB | ||||
24 | Accepted | 16ms | 3140 KiB | ||||
25 | Accepted | 16ms | 3236 KiB | ||||
26 | Accepted | 17ms | 3128 KiB | ||||
subtask4 | 40/40 | ||||||
27 | Accepted | 155ms | 24888 KiB | ||||
28 | Accepted | 207ms | 24976 KiB | ||||
29 | Accepted | 158ms | 25056 KiB | ||||
30 | Accepted | 171ms | 25020 KiB | ||||
31 | Accepted | 180ms | 25040 KiB | ||||
32 | Accepted | 157ms | 25048 KiB | ||||
33 | Accepted | 256ms | 24924 KiB | ||||
34 | Accepted | 237ms | 24956 KiB | ||||
35 | Accepted | 180ms | 25040 KiB | ||||
36 | Accepted | 175ms | 24916 KiB | ||||
37 | Accepted | 152ms | 24896 KiB | ||||
38 | Accepted | 71ms | 6124 KiB | ||||
39 | Accepted | 140ms | 23692 KiB | ||||
40 | Accepted | 148ms | 24996 KiB | ||||
41 | Accepted | 107ms | 16348 KiB | ||||
42 | Accepted | 144ms | 26344 KiB | ||||
43 | Accepted | 108ms | 23236 KiB |