119272024-11-20 16:18:44kochvPontos Átlagpython3Wrong answer 0/1001.1s26428 KiB
N,K = map(int,input().strip().split())
P = list(map(int,input().strip().split()))
o = K*len(P)
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
1Accepted16ms2872 KiB
2Accepted16ms3080 KiB
subtask20/20
3Accepted16ms2928 KiB
4Accepted16ms3064 KiB
5Accepted14ms3100 KiB
6Accepted16ms2872 KiB
7Accepted17ms3048 KiB
8Accepted17ms2872 KiB
9Accepted16ms2912 KiB
10Accepted16ms3096 KiB
11Accepted16ms3128 KiB
12Accepted16ms2944 KiB
13Wrong answer16ms3128 KiB
subtask30/40
14Accepted17ms3320 KiB
15Partially correct30ms3228 KiB
16Accepted16ms3260 KiB
17Partially correct20ms3128 KiB
18Partially correct29ms3220 KiB
19Partially correct26ms3188 KiB
20Wrong answer30ms3232 KiB
21Accepted16ms3232 KiB
22Wrong answer23ms3128 KiB
23Partially correct16ms2976 KiB
24Wrong answer16ms3016 KiB
25Accepted16ms3104 KiB
26Wrong answer17ms3044 KiB
subtask40/40
27Accepted85ms24920 KiB
28Time limit exceeded1.1s25024 KiB
29Time limit exceeded1.1s25076 KiB
30Time limit exceeded1.1s25052 KiB
31Time limit exceeded1.087s25056 KiB
32Time limit exceeded1.082s24944 KiB
33Time limit exceeded1.08s25044 KiB
34Time limit exceeded1.082s24868 KiB
35Time limit exceeded1.087s25048 KiB
36Time limit exceeded1.08s25072 KiB
37Accepted75ms25056 KiB
38Time limit exceeded1.078s7084 KiB
39Accepted94ms23780 KiB
40Wrong answer104ms24848 KiB
41Partially correct93ms17368 KiB
42Wrong answer103ms26428 KiB
43Wrong answer92ms23288 KiB