11743 | 2024-11-08 15:33:17 | matthias | Pontos Átlag | python3 | Accepted 100/100 | 209ms | 26340 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 | 3320 KiB | ||||
2 | Accepted | 16ms | 3008 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 16ms | 3040 KiB | ||||
4 | Accepted | 16ms | 2872 KiB | ||||
5 | Accepted | 16ms | 2900 KiB | ||||
6 | Accepted | 14ms | 3036 KiB | ||||
7 | Accepted | 16ms | 2872 KiB | ||||
8 | Accepted | 16ms | 2888 KiB | ||||
9 | Accepted | 16ms | 3060 KiB | ||||
10 | Accepted | 16ms | 3120 KiB | ||||
11 | Accepted | 16ms | 3092 KiB | ||||
12 | Accepted | 14ms | 2952 KiB | ||||
13 | Accepted | 16ms | 3040 KiB | ||||
subtask3 | 40/40 | ||||||
14 | Accepted | 17ms | 3128 KiB | ||||
15 | Accepted | 17ms | 3128 KiB | ||||
16 | Accepted | 16ms | 3128 KiB | ||||
17 | Accepted | 17ms | 3188 KiB | ||||
18 | Accepted | 16ms | 3128 KiB | ||||
19 | Accepted | 17ms | 3224 KiB | ||||
20 | Accepted | 16ms | 3140 KiB | ||||
21 | Accepted | 16ms | 3240 KiB | ||||
22 | Accepted | 17ms | 3064 KiB | ||||
23 | Accepted | 16ms | 3136 KiB | ||||
24 | Accepted | 16ms | 3128 KiB | ||||
25 | Accepted | 16ms | 3128 KiB | ||||
26 | Accepted | 14ms | 3176 KiB | ||||
subtask4 | 40/40 | ||||||
27 | Accepted | 177ms | 25044 KiB | ||||
28 | Accepted | 188ms | 25052 KiB | ||||
29 | Accepted | 167ms | 24832 KiB | ||||
30 | Accepted | 193ms | 24864 KiB | ||||
31 | Accepted | 199ms | 25036 KiB | ||||
32 | Accepted | 178ms | 25020 KiB | ||||
33 | Accepted | 208ms | 24836 KiB | ||||
34 | Accepted | 209ms | 25040 KiB | ||||
35 | Accepted | 181ms | 24968 KiB | ||||
36 | Accepted | 150ms | 24916 KiB | ||||
37 | Accepted | 171ms | 24900 KiB | ||||
38 | Accepted | 79ms | 7152 KiB | ||||
39 | Accepted | 155ms | 23756 KiB | ||||
40 | Accepted | 164ms | 24992 KiB | ||||
41 | Accepted | 127ms | 16500 KiB | ||||
42 | Accepted | 150ms | 26340 KiB | ||||
43 | Accepted | 120ms | 23096 KiB |