11609 | 2024-10-30 19:02:33 | Kezdő | Pontos Átlag | python3 | Accepted 100/100 | 232ms | 26352 KiB |
N,K = [int(i) for i in input().split()]
P = [int(i) for i in input().split()]
d = N*K - sum(P)
if d > 0:
print(1)
elif d == 0:
print(0)
else:
P.sort(reverse = True)
i = 0
while i < N and d < 0:
d += (P[i]-1)
i += 1
print(i)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 16ms | 3128 KiB | ||||
2 | Accepted | 16ms | 2876 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 16ms | 3100 KiB | ||||
4 | Accepted | 16ms | 3096 KiB | ||||
5 | Accepted | 14ms | 2940 KiB | ||||
6 | Accepted | 16ms | 3116 KiB | ||||
7 | Accepted | 16ms | 3144 KiB | ||||
8 | Accepted | 17ms | 3128 KiB | ||||
9 | Accepted | 16ms | 3132 KiB | ||||
10 | Accepted | 16ms | 3144 KiB | ||||
11 | Accepted | 16ms | 3128 KiB | ||||
12 | Accepted | 16ms | 3144 KiB | ||||
13 | Accepted | 14ms | 3128 KiB | ||||
subtask3 | 40/40 | ||||||
14 | Accepted | 16ms | 3060 KiB | ||||
15 | Accepted | 17ms | 3128 KiB | ||||
16 | Accepted | 16ms | 3128 KiB | ||||
17 | Accepted | 14ms | 3056 KiB | ||||
18 | Accepted | 17ms | 3128 KiB | ||||
19 | Accepted | 17ms | 3228 KiB | ||||
20 | Accepted | 17ms | 3128 KiB | ||||
21 | Accepted | 16ms | 3312 KiB | ||||
22 | Accepted | 16ms | 2904 KiB | ||||
23 | Accepted | 16ms | 3200 KiB | ||||
24 | Accepted | 16ms | 3076 KiB | ||||
25 | Accepted | 16ms | 3128 KiB | ||||
26 | Accepted | 16ms | 3084 KiB | ||||
subtask4 | 40/40 | ||||||
27 | Accepted | 82ms | 24964 KiB | ||||
28 | Accepted | 180ms | 24932 KiB | ||||
29 | Accepted | 172ms | 24940 KiB | ||||
30 | Accepted | 185ms | 24984 KiB | ||||
31 | Accepted | 174ms | 25052 KiB | ||||
32 | Accepted | 171ms | 25052 KiB | ||||
33 | Accepted | 211ms | 25052 KiB | ||||
34 | Accepted | 232ms | 25052 KiB | ||||
35 | Accepted | 180ms | 25056 KiB | ||||
36 | Accepted | 160ms | 24928 KiB | ||||
37 | Accepted | 87ms | 25052 KiB | ||||
38 | Accepted | 75ms | 6240 KiB | ||||
39 | Accepted | 146ms | 23764 KiB | ||||
40 | Accepted | 156ms | 24860 KiB | ||||
41 | Accepted | 115ms | 16504 KiB | ||||
42 | Accepted | 152ms | 26352 KiB | ||||
43 | Accepted | 115ms | 23300 KiB |