97022024-03-02 12:52:13szellandPontos Átlagpython3Wrong answer 0/1001.085s44928 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)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms11232 KiB
2Accepted17ms11388 KiB
subtask20/20
3Accepted17ms11768 KiB
4Accepted18ms12032 KiB
5Accepted17ms11992 KiB
6Accepted17ms11812 KiB
7Wrong answer17ms11928 KiB
8Accepted17ms12216 KiB
9Wrong answer17ms12288 KiB
10Accepted17ms12592 KiB
11Accepted17ms12400 KiB
12Accepted17ms12648 KiB
13Wrong answer17ms12584 KiB
subtask30/40
14Accepted17ms13112 KiB
15Partially correct18ms13212 KiB
16Wrong answer18ms13232 KiB
17Partially correct18ms13108 KiB
18Partially correct19ms13364 KiB
19Partially correct19ms13492 KiB
20Accepted19ms13292 KiB
21Accepted18ms13172 KiB
22Runtime error20ms13216 KiB
23Partially correct18ms13048 KiB
24Wrong answer19ms13692 KiB
25Partially correct19ms13476 KiB
26Wrong answer75ms13404 KiB
subtask40/40
27Accepted145ms44156 KiB
28Time limit exceeded1.067s21296 KiB
29Time limit exceeded1.08s21480 KiB
30Time limit exceeded1.085s21492 KiB
31Time limit exceeded1.064s21492 KiB
32Time limit exceeded1.075s21524 KiB
33Time limit exceeded1.052s22088 KiB
34Time limit exceeded1.072s21920 KiB
35Time limit exceeded1.065s21908 KiB
36Accepted301ms44928 KiB
37Accepted142ms44544 KiB
38Runtime error654ms19984 KiB
39Time limit exceeded1.08s21184 KiB
40Time limit exceeded1.072s21972 KiB
41Time limit exceeded1.072s16144 KiB
42Time limit exceeded1.083s22224 KiB
43Time limit exceeded1.064s22180 KiB