12154 | 2024-12-04 15:53:21 | Xetoxino | Pontos Átlag | python3 | Accepted 100/100 | 238ms | 26468 KiB |
N, K = [int(i) for i in input().split()]
T = [int(i) for i in input().split()]
E = sum(T)
if E == K * N:
print(0)
elif E < K * N:
print(1)
else:
T.sort(reverse = True)
i = 0
while E > K * N:
E = E - (T[i]-1)
i = i + 1
print(i)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 16ms | 3108 KiB | ||||
2 | Accepted | 16ms | 3012 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 16ms | 2900 KiB | ||||
4 | Accepted | 14ms | 3024 KiB | ||||
5 | Accepted | 16ms | 2876 KiB | ||||
6 | Accepted | 16ms | 3128 KiB | ||||
7 | Accepted | 17ms | 2972 KiB | ||||
8 | Accepted | 17ms | 3096 KiB | ||||
9 | Accepted | 16ms | 2908 KiB | ||||
10 | Accepted | 16ms | 3108 KiB | ||||
11 | Accepted | 16ms | 3324 KiB | ||||
12 | Accepted | 17ms | 3128 KiB | ||||
13 | Accepted | 16ms | 3296 KiB | ||||
subtask3 | 40/40 | ||||||
14 | Accepted | 17ms | 3040 KiB | ||||
15 | Accepted | 17ms | 3128 KiB | ||||
16 | Accepted | 17ms | 3128 KiB | ||||
17 | Accepted | 16ms | 3128 KiB | ||||
18 | Accepted | 17ms | 3144 KiB | ||||
19 | Accepted | 17ms | 3228 KiB | ||||
20 | Accepted | 17ms | 3240 KiB | ||||
21 | Accepted | 17ms | 3044 KiB | ||||
22 | Accepted | 17ms | 3092 KiB | ||||
23 | Accepted | 16ms | 3068 KiB | ||||
24 | Accepted | 16ms | 3128 KiB | ||||
25 | Accepted | 17ms | 3128 KiB | ||||
26 | Accepted | 17ms | 3056 KiB | ||||
subtask4 | 40/40 | ||||||
27 | Accepted | 90ms | 25552 KiB | ||||
28 | Accepted | 189ms | 25540 KiB | ||||
29 | Accepted | 165ms | 25552 KiB | ||||
30 | Accepted | 178ms | 25568 KiB | ||||
31 | Accepted | 202ms | 25552 KiB | ||||
32 | Accepted | 160ms | 25688 KiB | ||||
33 | Accepted | 216ms | 25536 KiB | ||||
34 | Accepted | 238ms | 25640 KiB | ||||
35 | Accepted | 201ms | 25696 KiB | ||||
36 | Accepted | 152ms | 24920 KiB | ||||
37 | Accepted | 82ms | 25552 KiB | ||||
38 | Accepted | 75ms | 7088 KiB | ||||
39 | Accepted | 159ms | 24768 KiB | ||||
40 | Accepted | 146ms | 24852 KiB | ||||
41 | Accepted | 120ms | 17244 KiB | ||||
42 | Accepted | 146ms | 26468 KiB | ||||
43 | Accepted | 123ms | 23328 KiB |