110822024-07-06 16:54:22probaKarácsonyi égőkpython3Wrong answer 0/10018ms3172 KiB
#egok
sor1 = "11 3"

sor2 = "1 1 0 0 2 2 1 1 1 2 2"

N = int(sor1.split(' ')[0])
C = int(sor1.split(' ')[1])
lista = [int(i) for i in sor2.split(' ')]

def vizsgal(resz):
    ok = [0]*C
    
    for i in range(C):
        if i in resz:
            ok[i] = 1
    return ok.count(1) != C

i, h = 0, C

while vizsgal(lista[i:i+h+1]) and h < N:
    if i<(N-h):
        i += 1
    else:
        i = 0
        h += 1
print(h+1)        
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer17ms2980 KiB
2Accepted17ms2980 KiB
subtask20/15
3Wrong answer18ms3048 KiB
4Wrong answer17ms2980 KiB
5Wrong answer17ms2952 KiB
6Wrong answer17ms3044 KiB
7Wrong answer17ms2844 KiB
subtask30/10
8Wrong answer18ms3044 KiB
9Wrong answer17ms2956 KiB
10Wrong answer17ms2980 KiB
11Wrong answer17ms3044 KiB
12Wrong answer17ms2912 KiB
subtask40/20
13Wrong answer17ms3068 KiB
14Wrong answer17ms3044 KiB
15Wrong answer17ms3064 KiB
16Wrong answer17ms3056 KiB
17Wrong answer17ms3044 KiB
subtask50/25
18Wrong answer18ms2972 KiB
19Wrong answer18ms2920 KiB
20Wrong answer17ms3172 KiB
21Wrong answer17ms2880 KiB
22Wrong answer17ms2916 KiB
subtask60/30
23Wrong answer18ms3044 KiB
24Wrong answer17ms2940 KiB
25Wrong answer18ms3044 KiB
26Wrong answer17ms3092 KiB
27Wrong answer17ms3044 KiB
28Wrong answer17ms3044 KiB
29Wrong answer17ms3064 KiB
30Wrong answer17ms3044 KiB