117232024-11-07 19:18:29bajozsaPontos Átlagpython3Wrong answer 0/1001.101s26312 KiB
N, K = map(int, input().strip().split())
P = list(map(int, input().strip().split()))
P.sort(reverse=True)
atlagKulonbseg = N*K-sum(P)
modositva = False
for i in range(N+1):
    if atlagKulonbseg > 0:
        if modositva:
            print(i)
        else:
            print(i+1)
            break
    elif atlagKulonbseg == 0:
        if modositva:
            print(i+1)
        else:
            print(i)
            break
    else:
        modositva = True
        P[i] = 1
        atlagKulonbseg = N*K-sum(P)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms3128 KiB
2Accepted16ms3128 KiB
subtask20/20
3Accepted16ms3120 KiB
4Accepted17ms3124 KiB
5Accepted16ms2968 KiB
6Accepted17ms3124 KiB
7Wrong answer16ms3108 KiB
8Accepted16ms2948 KiB
9Wrong answer14ms2924 KiB
10Accepted16ms3020 KiB
11Accepted16ms3132 KiB
12Accepted16ms3372 KiB
13Wrong answer16ms3128 KiB
subtask30/40
14Accepted17ms3092 KiB
15Wrong answer23ms3232 KiB
16Wrong answer17ms3128 KiB
17Wrong answer17ms3248 KiB
18Wrong answer24ms3216 KiB
19Wrong answer21ms3120 KiB
20Wrong answer25ms3224 KiB
21Accepted17ms3128 KiB
22Wrong answer17ms3136 KiB
23Wrong answer17ms3120 KiB
24Wrong answer17ms3128 KiB
25Wrong answer17ms3128 KiB
26Wrong answer16ms3136 KiB
subtask40/40
27Accepted167ms25052 KiB
28Time limit exceeded1.1s25048 KiB
29Time limit exceeded1.1s24860 KiB
30Time limit exceeded1.101s24912 KiB
31Time limit exceeded1.088s25048 KiB
32Time limit exceeded1.087s25052 KiB
33Time limit exceeded1.085s24924 KiB
34Time limit exceeded1.085s25052 KiB
35Time limit exceeded1.088s25048 KiB
36Time limit exceeded1.085s24872 KiB
37Accepted172ms24940 KiB
38Wrong answer194ms7028 KiB
39Wrong answer272ms23760 KiB
40Wrong answer308ms24876 KiB
41Wrong answer244ms16532 KiB
42Wrong answer277ms26312 KiB
43Wrong answer254ms23276 KiB