97062024-03-02 13:40:07szellandPontos Átlagpython3Wrong answer 0/100312ms44316 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
celossz = darabszam * eg_cel_atl

atlag = 0
for i in range(len(bem)):
    bem[i] = (int(bem[i]))
    ossz += bem[i]
atlag = ossz / darabszam
cskell = ossz - celossz
#print(cskell)
#print(atlag)
#print(bem)
valtkell = 0
#paratlan = False
if atlag < cel_atl:
    print(1)
elif atlag == cel_atl:
    print(0)
else:
    bem.sort(reverse = True)
    szaml = 0
    while ossz != celossz:
        if cskell <= bem[szaml]:
            print(valtkell + 1)
            break
        else:
            cskell -= bem[szaml] - 1
            szaml += 1
            valtkell += 1
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer17ms11256 KiB
2Accepted18ms11588 KiB
subtask20/20
3Accepted17ms11764 KiB
4Accepted17ms11772 KiB
5Accepted17ms11840 KiB
6Accepted17ms12300 KiB
7Accepted17ms12464 KiB
8Accepted17ms12556 KiB
9Accepted17ms12800 KiB
10Accepted17ms12604 KiB
11Wrong answer17ms12500 KiB
12Wrong answer17ms12524 KiB
13Accepted17ms12856 KiB
subtask30/40
14Accepted17ms13196 KiB
15Accepted18ms13288 KiB
16Accepted17ms13396 KiB
17Accepted18ms13216 KiB
18Accepted19ms13180 KiB
19Accepted18ms13228 KiB
20Accepted18ms13452 KiB
21Accepted17ms13176 KiB
22Accepted17ms13156 KiB
23Wrong answer17ms13404 KiB
24Accepted18ms13504 KiB
25Wrong answer17ms13392 KiB
26Accepted17ms13520 KiB
subtask40/40
27Accepted143ms44108 KiB
28Accepted261ms43896 KiB
29Accepted232ms43776 KiB
30Accepted263ms43844 KiB
31Accepted246ms44084 KiB
32Accepted223ms43856 KiB
33Accepted303ms43776 KiB
34Accepted312ms43928 KiB
35Accepted259ms44100 KiB
36Accepted261ms44124 KiB
37Accepted153ms44068 KiB
38Accepted145ms19928 KiB
39Wrong answer219ms42628 KiB
40Accepted211ms44280 KiB
41Wrong answer180ms32848 KiB
42Accepted215ms44212 KiB
43Accepted184ms44316 KiB