12176 | 2024-12-06 15:32:52 | DianaTaylor | Pontos Átlag | python3 | Accepted 100/100 | 236ms | 26468 KiB |
N,K=[int(i) for i in input(). split()]
P=[int(i) for i in input(). split()]
i=0
s=sum(P)
if s == N*K:
print(0)
elif s < N*K:
print(1)
else:
P.sort(reverse=True)
while s > N*K:
s=s-(P[i]-1)
i+=1
print(i)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 14ms | 3116 KiB | ||||
2 | Accepted | 14ms | 3128 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 17ms | 3128 KiB | ||||
4 | Accepted | 17ms | 3144 KiB | ||||
5 | Accepted | 14ms | 3128 KiB | ||||
6 | Accepted | 16ms | 3128 KiB | ||||
7 | Accepted | 17ms | 3304 KiB | ||||
8 | Accepted | 17ms | 3068 KiB | ||||
9 | Accepted | 16ms | 3124 KiB | ||||
10 | Accepted | 16ms | 2944 KiB | ||||
11 | Accepted | 16ms | 3336 KiB | ||||
12 | Accepted | 16ms | 3052 KiB | ||||
13 | Accepted | 14ms | 3128 KiB | ||||
subtask3 | 40/40 | ||||||
14 | Accepted | 17ms | 3256 KiB | ||||
15 | Accepted | 17ms | 3132 KiB | ||||
16 | Accepted | 17ms | 3232 KiB | ||||
17 | Accepted | 16ms | 3128 KiB | ||||
18 | Accepted | 17ms | 3132 KiB | ||||
19 | Accepted | 16ms | 3128 KiB | ||||
20 | Accepted | 16ms | 3268 KiB | ||||
21 | Accepted | 17ms | 3064 KiB | ||||
22 | Accepted | 17ms | 2996 KiB | ||||
23 | Accepted | 17ms | 3192 KiB | ||||
24 | Accepted | 16ms | 3136 KiB | ||||
25 | Accepted | 16ms | 3032 KiB | ||||
26 | Accepted | 14ms | 3128 KiB | ||||
subtask4 | 40/40 | ||||||
27 | Accepted | 90ms | 25724 KiB | ||||
28 | Accepted | 208ms | 25720 KiB | ||||
29 | Accepted | 162ms | 25556 KiB | ||||
30 | Accepted | 172ms | 25556 KiB | ||||
31 | Accepted | 199ms | 25768 KiB | ||||
32 | Accepted | 160ms | 25556 KiB | ||||
33 | Accepted | 211ms | 25608 KiB | ||||
34 | Accepted | 236ms | 25552 KiB | ||||
35 | Accepted | 206ms | 25552 KiB | ||||
36 | Accepted | 151ms | 24920 KiB | ||||
37 | Accepted | 89ms | 25556 KiB | ||||
38 | Accepted | 76ms | 7128 KiB | ||||
39 | Accepted | 168ms | 24776 KiB | ||||
40 | Accepted | 166ms | 25048 KiB | ||||
41 | Accepted | 114ms | 17216 KiB | ||||
42 | Accepted | 152ms | 26468 KiB | ||||
43 | Accepted | 123ms | 23128 KiB |