97052024-03-02 13:26:30szellandPontos Átlagpython3Wrong answer 0/100234ms46088 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
cskell = ossz - celossz

atlag = 0
for i in range(len(bem)):
    bem[i] = (int(bem[i]))
    ossz += bem[i]
atlag = ossz / darabszam
#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 answer17ms11248 KiB
2Accepted17ms11548 KiB
subtask20/20
3Accepted17ms11788 KiB
4Accepted17ms11648 KiB
5Accepted17ms11824 KiB
6Accepted17ms12296 KiB
7Accepted17ms12396 KiB
8Wrong answer17ms12608 KiB
9Accepted17ms12596 KiB
10Accepted17ms12932 KiB
11Wrong answer17ms13048 KiB
12Wrong answer17ms13400 KiB
13Accepted17ms13504 KiB
subtask30/40
14Accepted18ms13512 KiB
15Wrong answer18ms13732 KiB
16Accepted18ms14028 KiB
17Wrong answer17ms14160 KiB
18Wrong answer17ms14172 KiB
19Wrong answer18ms14100 KiB
20Wrong answer18ms14220 KiB
21Accepted18ms14392 KiB
22Accepted18ms14364 KiB
23Wrong answer18ms14460 KiB
24Accepted19ms14580 KiB
25Wrong answer18ms14884 KiB
26Accepted18ms14564 KiB
subtask40/40
27Accepted144ms44696 KiB
28Wrong answer212ms44824 KiB
29Wrong answer234ms45196 KiB
30Wrong answer210ms45036 KiB
31Wrong answer208ms45152 KiB
32Wrong answer212ms45124 KiB
33Wrong answer209ms44956 KiB
34Wrong answer209ms45124 KiB
35Wrong answer209ms44900 KiB
36Wrong answer150ms45964 KiB
37Accepted146ms44980 KiB
38Accepted146ms19252 KiB
39Wrong answer217ms43572 KiB
40Accepted207ms45128 KiB
41Wrong answer188ms34116 KiB
42Accepted200ms46088 KiB
43Accepted187ms45380 KiB