97092024-03-02 13:41:54szellandPontos Átlagpython3Wrong answer 0/100308ms45380 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 answer17ms11376 KiB
2Accepted18ms11620 KiB
subtask20/20
3Accepted17ms11552 KiB
4Accepted17ms11680 KiB
5Accepted17ms12096 KiB
6Accepted17ms12124 KiB
7Accepted17ms12380 KiB
8Accepted17ms12264 KiB
9Accepted17ms12168 KiB
10Accepted17ms12660 KiB
11Wrong answer17ms12344 KiB
12Wrong answer17ms12772 KiB
13Accepted17ms13172 KiB
subtask30/40
14Accepted17ms13036 KiB
15Accepted18ms13280 KiB
16Accepted17ms13172 KiB
17Accepted18ms13308 KiB
18Accepted19ms13168 KiB
19Accepted18ms13208 KiB
20Accepted18ms13516 KiB
21Accepted18ms13756 KiB
22Accepted18ms13556 KiB
23Wrong answer18ms13988 KiB
24Accepted18ms14028 KiB
25Wrong answer17ms13828 KiB
26Accepted17ms14004 KiB
subtask40/40
27Accepted152ms44972 KiB
28Accepted256ms45204 KiB
29Accepted254ms45164 KiB
30Accepted236ms45032 KiB
31Accepted244ms45192 KiB
32Accepted225ms45220 KiB
33Accepted308ms45256 KiB
34Accepted307ms45040 KiB
35Accepted254ms45148 KiB
36Accepted263ms45328 KiB
37Accepted148ms45236 KiB
38Accepted143ms20672 KiB
39Wrong answer218ms43512 KiB
40Accepted214ms45364 KiB
41Wrong answer181ms33916 KiB
42Accepted210ms45176 KiB
43Accepted182ms45380 KiB