118122024-11-11 19:28:39bajozsaPontos Átlagpython3Wrong answer 0/1001.1s26344 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:
        print(i + 1 if not modositva else i)
        break
    elif atlagKulonbseg == 0:
        print(i if not modositva else i + 1)
        break
    else:
        P[i] = 1
        atlagKulonbseg = N * K - sum(P)
        modositva = True
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted16ms3128 KiB
2Accepted16ms3132 KiB
subtask20/20
3Accepted17ms3128 KiB
4Accepted17ms3132 KiB
5Accepted16ms3120 KiB
6Accepted16ms3160 KiB
7Accepted16ms3128 KiB
8Accepted16ms3136 KiB
9Accepted17ms3128 KiB
10Accepted16ms3128 KiB
11Accepted17ms3304 KiB
12Accepted16ms3128 KiB
13Wrong answer16ms3128 KiB
subtask30/40
14Accepted16ms3084 KiB
15Accepted23ms3128 KiB
16Accepted17ms3020 KiB
17Accepted17ms3024 KiB
18Accepted23ms3100 KiB
19Accepted19ms3128 KiB
20Wrong answer24ms3128 KiB
21Accepted16ms3228 KiB
22Accepted16ms3128 KiB
23Accepted16ms3052 KiB
24Wrong answer17ms3128 KiB
25Accepted16ms3128 KiB
26Wrong answer16ms3132 KiB
subtask40/40
27Accepted151ms24896 KiB
28Time limit exceeded1.1s24864 KiB
29Time limit exceeded1.1s25052 KiB
30Time limit exceeded1.1s24844 KiB
31Time limit exceeded1.085s25044 KiB
32Time limit exceeded1.082s24900 KiB
33Time limit exceeded1.082s24872 KiB
34Time limit exceeded1.082s25040 KiB
35Time limit exceeded1.082s25048 KiB
36Time limit exceeded1.082s24924 KiB
37Accepted145ms25040 KiB
38Accepted70ms7088 KiB
39Accepted144ms23752 KiB
40Wrong answer141ms24988 KiB
41Accepted125ms16532 KiB
42Wrong answer137ms26344 KiB
43Wrong answer123ms23288 KiB