119302024-11-20 16:42:09kochvPontos Átlagpython3Wrong answer 0/1001.095s26340 KiB
N,K = map(int,input().strip().split())
P = list(map(int,input().strip().split()))
o = K*len(P)
P.sort()
if o == sum(P):
    print(str(0))
elif o > sum(P):
    print(str(1))
else:
    i = -1
    while o != sum(P):
        if P[i]> sum(P)-o +1:
            P[i] -= (sum(P) - o)
        else:
            P[i] = 1
            i -=1
    print(str(-i))

    
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms2944 KiB
2Accepted16ms3020 KiB
subtask20/20
3Accepted16ms3128 KiB
4Accepted17ms3144 KiB
5Accepted16ms3128 KiB
6Accepted16ms2988 KiB
7Accepted16ms2888 KiB
8Accepted14ms3104 KiB
9Accepted16ms2976 KiB
10Accepted16ms3072 KiB
11Accepted14ms3128 KiB
12Accepted14ms3116 KiB
13Wrong answer16ms2992 KiB
subtask30/40
14Accepted17ms3208 KiB
15Accepted28ms3128 KiB
16Accepted16ms3128 KiB
17Accepted18ms3312 KiB
18Accepted28ms3236 KiB
19Accepted23ms3148 KiB
20Wrong answer30ms3124 KiB
21Accepted16ms3252 KiB
22Accepted16ms2984 KiB
23Accepted16ms3124 KiB
24Wrong answer16ms3240 KiB
25Accepted16ms3132 KiB
26Wrong answer14ms3148 KiB
subtask40/40
27Accepted153ms25048 KiB
28Time limit exceeded1.083s24888 KiB
29Time limit exceeded1.083s25160 KiB
30Time limit exceeded1.083s25048 KiB
31Time limit exceeded1.095s25052 KiB
32Time limit exceeded1.083s25048 KiB
33Time limit exceeded1.083s25052 KiB
34Time limit exceeded1.085s25108 KiB
35Time limit exceeded1.092s25048 KiB
36Time limit exceeded1.082s24876 KiB
37Accepted172ms25044 KiB
38Accepted75ms7092 KiB
39Accepted156ms23760 KiB
40Wrong answer148ms24996 KiB
41Accepted135ms17200 KiB
42Wrong answer143ms26340 KiB
43Wrong answer129ms23168 KiB