97042024-03-02 13:22:14szellandPontos Átlagpython3Wrong answer 0/100246ms45768 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
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer17ms11236 KiB
2Accepted17ms11436 KiB
subtask20/20
3Accepted18ms11696 KiB
4Accepted17ms12000 KiB
5Accepted17ms12044 KiB
6Accepted17ms12476 KiB
7Accepted17ms12612 KiB
8Wrong answer17ms12924 KiB
9Accepted17ms12780 KiB
10Accepted17ms12708 KiB
11Wrong answer17ms12620 KiB
12Wrong answer17ms12796 KiB
13Accepted17ms12804 KiB
subtask30/40
14Accepted17ms13112 KiB
15Wrong answer18ms13368 KiB
16Accepted18ms13272 KiB
17Wrong answer17ms13604 KiB
18Wrong answer17ms13656 KiB
19Wrong answer17ms14016 KiB
20Wrong answer18ms14096 KiB
21Accepted18ms13820 KiB
22Accepted18ms14148 KiB
23Wrong answer18ms14232 KiB
24Accepted18ms14224 KiB
25Wrong answer18ms14168 KiB
26Accepted18ms14236 KiB
subtask40/40
27Accepted148ms44584 KiB
28Wrong answer229ms44572 KiB
29Wrong answer246ms44992 KiB
30Wrong answer223ms44340 KiB
31Wrong answer210ms44728 KiB
32Wrong answer224ms44724 KiB
33Wrong answer209ms44720 KiB
34Wrong answer212ms44476 KiB
35Wrong answer210ms44704 KiB
36Wrong answer162ms45768 KiB
37Accepted146ms44684 KiB
38Accepted142ms19380 KiB
39Wrong answer209ms43604 KiB
40Accepted209ms44808 KiB
41Wrong answer187ms33580 KiB
42Accepted210ms45084 KiB
43Accepted181ms45376 KiB