97112024-03-02 13:44:02szellandPontos Átlagpython3Wrong answer 0/100291ms45340 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]
            szaml += 1
            valtkell += 1
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer17ms11112 KiB
2Accepted17ms11380 KiB
subtask20/20
3Accepted17ms11692 KiB
4Accepted17ms11884 KiB
5Accepted17ms11964 KiB
6Accepted17ms12044 KiB
7Accepted17ms12144 KiB
8Accepted17ms12072 KiB
9Accepted17ms12256 KiB
10Accepted17ms12424 KiB
11Wrong answer17ms12724 KiB
12Wrong answer17ms12940 KiB
13Accepted17ms12872 KiB
subtask30/40
14Accepted17ms12928 KiB
15Partially correct18ms13524 KiB
16Accepted17ms13376 KiB
17Accepted17ms13252 KiB
18Accepted19ms13508 KiB
19Accepted18ms13432 KiB
20Accepted18ms13620 KiB
21Accepted18ms13956 KiB
22Accepted17ms13880 KiB
23Wrong answer18ms14028 KiB
24Accepted18ms14052 KiB
25Wrong answer18ms13952 KiB
26Accepted18ms14256 KiB
subtask40/40
27Accepted150ms44632 KiB
28Partially correct270ms45024 KiB
29Accepted218ms44852 KiB
30Accepted236ms44856 KiB
31Accepted246ms45016 KiB
32Accepted218ms44920 KiB
33Accepted291ms44804 KiB
34Partially correct287ms44808 KiB
35Partially correct264ms45060 KiB
36Accepted254ms45228 KiB
37Accepted144ms45064 KiB
38Accepted143ms20712 KiB
39Wrong answer218ms43528 KiB
40Accepted216ms45340 KiB
41Wrong answer196ms33724 KiB
42Accepted209ms45340 KiB
43Accepted179ms45320 KiB