119292024-11-20 16:40:59kochvPontos Átlagpython3Runtime error 0/1001.1s26340 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(dtr(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
1Accepted16ms3320 KiB
2Runtime error16ms2940 KiB
subtask20/20
3Runtime error16ms3128 KiB
4Runtime error16ms3016 KiB
5Accepted16ms2956 KiB
6Runtime error14ms2932 KiB
7Accepted16ms3048 KiB
8Accepted17ms3128 KiB
9Accepted17ms3052 KiB
10Accepted16ms3128 KiB
11Accepted16ms3132 KiB
12Accepted16ms3320 KiB
13Wrong answer16ms3128 KiB
subtask30/40
14Runtime error16ms3236 KiB
15Accepted28ms3256 KiB
16Accepted16ms3128 KiB
17Accepted18ms3160 KiB
18Accepted28ms3232 KiB
19Accepted23ms3128 KiB
20Wrong answer29ms3224 KiB
21Accepted16ms3248 KiB
22Accepted17ms3128 KiB
23Accepted16ms3192 KiB
24Wrong answer16ms3140 KiB
25Accepted14ms3220 KiB
26Wrong answer17ms3128 KiB
subtask40/40
27Runtime error155ms25056 KiB
28Time limit exceeded1.1s25036 KiB
29Time limit exceeded1.1s25048 KiB
30Time limit exceeded1.1s24912 KiB
31Time limit exceeded1.092s25052 KiB
32Time limit exceeded1.09s25060 KiB
33Time limit exceeded1.088s25052 KiB
34Time limit exceeded1.088s25088 KiB
35Time limit exceeded1.087s25048 KiB
36Time limit exceeded1.09s24924 KiB
37Accepted172ms25048 KiB
38Accepted75ms7172 KiB
39Accepted155ms23764 KiB
40Wrong answer148ms25000 KiB
41Accepted136ms17376 KiB
42Wrong answer145ms26340 KiB
43Wrong answer115ms23288 KiB