11744 | 2024-11-08 15:34:46 | matthias | Pontos Átlag | python3 | Accepted 100/100 | 221ms | 26344 KiB |
n,k = [int(i) for i in input().split()]
p = sorted([int(i)-1 for i in input().split()],reverse = True)
d = (sum(p) + n ) - k*n
c = 0
if d < 0:
c = 1
else:
while d > 0:
d -= p[c]
c += 1
print(c)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 16ms | 3056 KiB | ||||
2 | Accepted | 16ms | 2876 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 17ms | 3044 KiB | ||||
4 | Accepted | 16ms | 3060 KiB | ||||
5 | Accepted | 16ms | 2996 KiB | ||||
6 | Accepted | 16ms | 2988 KiB | ||||
7 | Accepted | 16ms | 2888 KiB | ||||
8 | Accepted | 16ms | 3076 KiB | ||||
9 | Accepted | 17ms | 2872 KiB | ||||
10 | Accepted | 16ms | 3100 KiB | ||||
11 | Accepted | 16ms | 2880 KiB | ||||
12 | Accepted | 17ms | 2872 KiB | ||||
13 | Accepted | 16ms | 2872 KiB | ||||
subtask3 | 40/40 | ||||||
14 | Accepted | 17ms | 3044 KiB | ||||
15 | Accepted | 16ms | 3128 KiB | ||||
16 | Accepted | 17ms | 3128 KiB | ||||
17 | Accepted | 16ms | 3128 KiB | ||||
18 | Accepted | 17ms | 3116 KiB | ||||
19 | Accepted | 17ms | 3104 KiB | ||||
20 | Accepted | 17ms | 3120 KiB | ||||
21 | Accepted | 17ms | 3208 KiB | ||||
22 | Accepted | 17ms | 3124 KiB | ||||
23 | Accepted | 16ms | 2948 KiB | ||||
24 | Accepted | 16ms | 2984 KiB | ||||
25 | Accepted | 17ms | 3092 KiB | ||||
26 | Accepted | 16ms | 3320 KiB | ||||
subtask4 | 40/40 | ||||||
27 | Accepted | 174ms | 25040 KiB | ||||
28 | Accepted | 193ms | 25040 KiB | ||||
29 | Accepted | 172ms | 25048 KiB | ||||
30 | Accepted | 181ms | 25048 KiB | ||||
31 | Accepted | 204ms | 25040 KiB | ||||
32 | Accepted | 187ms | 25044 KiB | ||||
33 | Accepted | 221ms | 24884 KiB | ||||
34 | Accepted | 214ms | 24824 KiB | ||||
35 | Accepted | 200ms | 25044 KiB | ||||
36 | Accepted | 150ms | 24920 KiB | ||||
37 | Accepted | 159ms | 25072 KiB | ||||
38 | Accepted | 79ms | 7072 KiB | ||||
39 | Accepted | 155ms | 23752 KiB | ||||
40 | Accepted | 164ms | 24992 KiB | ||||
41 | Accepted | 123ms | 16304 KiB | ||||
42 | Accepted | 162ms | 26344 KiB | ||||
43 | Accepted | 120ms | 23188 KiB |