11986 | 2024-11-22 15:48:40 | Adam | Pontos Átlag | python3 | Accepted 100/100 | 224ms | 26208 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 | 2872 KiB | ||||
2 | Accepted | 16ms | 3128 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 14ms | 2876 KiB | ||||
4 | Accepted | 16ms | 3088 KiB | ||||
5 | Accepted | 16ms | 3052 KiB | ||||
6 | Accepted | 14ms | 2872 KiB | ||||
7 | Accepted | 16ms | 3068 KiB | ||||
8 | Accepted | 14ms | 3124 KiB | ||||
9 | Accepted | 16ms | 2872 KiB | ||||
10 | Accepted | 16ms | 2872 KiB | ||||
11 | Accepted | 14ms | 3320 KiB | ||||
12 | Accepted | 14ms | 3296 KiB | ||||
13 | Accepted | 16ms | 3128 KiB | ||||
subtask3 | 40/40 | ||||||
14 | Accepted | 16ms | 3232 KiB | ||||
15 | Accepted | 16ms | 3000 KiB | ||||
16 | Accepted | 16ms | 3072 KiB | ||||
17 | Accepted | 16ms | 3252 KiB | ||||
18 | Accepted | 17ms | 3100 KiB | ||||
19 | Accepted | 16ms | 3072 KiB | ||||
20 | Accepted | 16ms | 3248 KiB | ||||
21 | Accepted | 16ms | 3240 KiB | ||||
22 | Accepted | 16ms | 3312 KiB | ||||
23 | Accepted | 16ms | 3128 KiB | ||||
24 | Accepted | 16ms | 3112 KiB | ||||
25 | Accepted | 16ms | 3312 KiB | ||||
26 | Accepted | 16ms | 3192 KiB | ||||
subtask4 | 40/40 | ||||||
27 | Accepted | 182ms | 25044 KiB | ||||
28 | Accepted | 214ms | 24932 KiB | ||||
29 | Accepted | 193ms | 25000 KiB | ||||
30 | Accepted | 170ms | 24912 KiB | ||||
31 | Accepted | 179ms | 25044 KiB | ||||
32 | Accepted | 175ms | 25036 KiB | ||||
33 | Accepted | 204ms | 24952 KiB | ||||
34 | Accepted | 224ms | 25048 KiB | ||||
35 | Accepted | 187ms | 25040 KiB | ||||
36 | Accepted | 149ms | 24920 KiB | ||||
37 | Accepted | 158ms | 24896 KiB | ||||
38 | Accepted | 82ms | 7088 KiB | ||||
39 | Accepted | 178ms | 23756 KiB | ||||
40 | Accepted | 172ms | 24992 KiB | ||||
41 | Accepted | 123ms | 16392 KiB | ||||
42 | Accepted | 151ms | 26208 KiB | ||||
43 | Accepted | 122ms | 23288 KiB |