119282024-11-20 16:24:59kochvPontos Átlagpython3Wrong answer 0/1001.1s26264 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(0)
elif o > sum(P):
    print(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(-i)

    
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted16ms3320 KiB
2Accepted16ms3124 KiB
subtask20/20
3Accepted16ms3128 KiB
4Accepted16ms3120 KiB
5Accepted16ms2916 KiB
6Accepted14ms3128 KiB
7Accepted17ms3128 KiB
8Accepted14ms3140 KiB
9Accepted16ms3128 KiB
10Accepted16ms3132 KiB
11Accepted17ms3124 KiB
12Accepted17ms3132 KiB
13Wrong answer16ms3128 KiB
subtask30/40
14Accepted17ms3124 KiB
15Accepted28ms3128 KiB
16Accepted17ms3464 KiB
17Accepted19ms3236 KiB
18Accepted28ms3124 KiB
19Accepted23ms3312 KiB
20Wrong answer29ms3124 KiB
21Accepted16ms3128 KiB
22Accepted16ms3124 KiB
23Accepted16ms2964 KiB
24Wrong answer16ms3128 KiB
25Accepted14ms3128 KiB
26Wrong answer16ms3128 KiB
subtask40/40
27Accepted171ms24944 KiB
28Time limit exceeded1.1s24872 KiB
29Time limit exceeded1.1s24952 KiB
30Time limit exceeded1.1s25052 KiB
31Time limit exceeded1.09s25052 KiB
32Time limit exceeded1.072s25056 KiB
33Time limit exceeded1.072s24900 KiB
34Time limit exceeded1.072s25068 KiB
35Time limit exceeded1.085s24948 KiB
36Time limit exceeded1.083s24904 KiB
37Accepted177ms25052 KiB
38Accepted76ms7088 KiB
39Accepted158ms23888 KiB
40Wrong answer149ms24864 KiB
41Accepted138ms17204 KiB
42Wrong answer148ms26264 KiB
43Wrong answer130ms23316 KiB