9702 | 2024-03-02 12:52:13 | szelland | Pontos Átlag | python3 | Wrong answer 0/100 | 1.085s | 44928 KiB |
bem0 = input()
bem0 = bem0.split()
bem = input()
bem = bem.split()
cel_atl = float(bem0[1])
eg_cel_atl = int(cel_atl)
darabszam = int(bem0[0])
ossz = 0
atlag = 0
for i in range(len(bem)):
bem[i] = (int(bem[i]))
ossz += bem[i]
atlag = ossz / darabszam
#print(atlag)
#print(bem)
vatkell = 0
paratlan = False
if atlag < cel_atl:
print(1)
elif atlag == cel_atl:
print(0)
else:
for i in range(1, len(bem)):
#print(i)
if bem[-1] == eg_cel_atl:
del bem[-1]
'''
if len(bem) % 2 == 1:
valtkell += 1
paratlan = True
'''
bem.sort()
nagy = bem[-1]
kicsi = bem[0]
i_k = 0
i_n = len(bem) - 1
while i_k != i_n and i_k < i_n:
if (nagy + kicsi) / 2 < cel_atl:
i_k += 1
kicsi = bem[i_k]
elif (nagy + kicsi) / 2 > cel_atl:
i_n -= 1
nagy = bem[i_n]
else:
del bem[i_k]
del bem[i_n]
i_k = 0
i_n = len(bem) - 1
kicsi = bem[i_k]
nagy = bem[i_n]
lb = len(bem)
print(lb)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 17ms | 11232 KiB | ||||
2 | Accepted | 17ms | 11388 KiB | ||||
subtask2 | 0/20 | ||||||
3 | Accepted | 17ms | 11768 KiB | ||||
4 | Accepted | 18ms | 12032 KiB | ||||
5 | Accepted | 17ms | 11992 KiB | ||||
6 | Accepted | 17ms | 11812 KiB | ||||
7 | Wrong answer | 17ms | 11928 KiB | ||||
8 | Accepted | 17ms | 12216 KiB | ||||
9 | Wrong answer | 17ms | 12288 KiB | ||||
10 | Accepted | 17ms | 12592 KiB | ||||
11 | Accepted | 17ms | 12400 KiB | ||||
12 | Accepted | 17ms | 12648 KiB | ||||
13 | Wrong answer | 17ms | 12584 KiB | ||||
subtask3 | 0/40 | ||||||
14 | Accepted | 17ms | 13112 KiB | ||||
15 | Partially correct | 18ms | 13212 KiB | ||||
16 | Wrong answer | 18ms | 13232 KiB | ||||
17 | Partially correct | 18ms | 13108 KiB | ||||
18 | Partially correct | 19ms | 13364 KiB | ||||
19 | Partially correct | 19ms | 13492 KiB | ||||
20 | Accepted | 19ms | 13292 KiB | ||||
21 | Accepted | 18ms | 13172 KiB | ||||
22 | Runtime error | 20ms | 13216 KiB | ||||
23 | Partially correct | 18ms | 13048 KiB | ||||
24 | Wrong answer | 19ms | 13692 KiB | ||||
25 | Partially correct | 19ms | 13476 KiB | ||||
26 | Wrong answer | 75ms | 13404 KiB | ||||
subtask4 | 0/40 | ||||||
27 | Accepted | 145ms | 44156 KiB | ||||
28 | Time limit exceeded | 1.067s | 21296 KiB | ||||
29 | Time limit exceeded | 1.08s | 21480 KiB | ||||
30 | Time limit exceeded | 1.085s | 21492 KiB | ||||
31 | Time limit exceeded | 1.064s | 21492 KiB | ||||
32 | Time limit exceeded | 1.075s | 21524 KiB | ||||
33 | Time limit exceeded | 1.052s | 22088 KiB | ||||
34 | Time limit exceeded | 1.072s | 21920 KiB | ||||
35 | Time limit exceeded | 1.065s | 21908 KiB | ||||
36 | Accepted | 301ms | 44928 KiB | ||||
37 | Accepted | 142ms | 44544 KiB | ||||
38 | Runtime error | 654ms | 19984 KiB | ||||
39 | Time limit exceeded | 1.08s | 21184 KiB | ||||
40 | Time limit exceeded | 1.072s | 21972 KiB | ||||
41 | Time limit exceeded | 1.072s | 16144 KiB | ||||
42 | Time limit exceeded | 1.083s | 22224 KiB | ||||
43 | Time limit exceeded | 1.064s | 22180 KiB |