27552023-01-21 01:02:41rennKarácsonyi égőkpython3Time limit exceeded 10/1001.6s57648 KiB
sor = input().split()
N = int(sor[0])
C = int(sor[1])

sor = input().split()
egok = []

for E in sor:
    egok.append(int(E))

def megold():
    for X in range(C, N):
        for Y in range(0, N-X):
            tomb = [False for i in range(0, C)]
            for Z in range(Y, Y+X):
                K = egok[Z]
                tomb[K] = True
            if False not in tomb:
                print(X)
                return True
    return False


if not megold():
    print(N)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted17ms11016 KiB
2Accepted17ms11388 KiB
subtask20/15
3Time limit exceeded1.6s7544 KiB
4Time limit exceeded1.578s7524 KiB
5Time limit exceeded1.559s7604 KiB
6Time limit exceeded1.578s4572 KiB
7Time limit exceeded1.57s4880 KiB
subtask310/10
8Accepted17ms12576 KiB
9Accepted17ms12768 KiB
10Accepted18ms12940 KiB
11Accepted18ms12608 KiB
12Accepted17ms13016 KiB
subtask40/20
13Time limit exceeded1.524s13240 KiB
14Accepted448ms13160 KiB
15Accepted108ms13448 KiB
16Accepted1.22s13552 KiB
17Accepted816ms13412 KiB
subtask50/25
18Accepted18ms14816 KiB
19Time limit exceeded1.6s6616 KiB
20Time limit exceeded1.567s6644 KiB
21Time limit exceeded1.567s6644 KiB
22Time limit exceeded1.575s6392 KiB
subtask60/30
23Accepted118ms57648 KiB
24Time limit exceeded1.557s25536 KiB
25Time limit exceeded1.565s28204 KiB
26Time limit exceeded1.569s29356 KiB
27Time limit exceeded1.585s29808 KiB
28Time limit exceeded1.583s28268 KiB
29Time limit exceeded1.572s25624 KiB
30Time limit exceeded1.575s9628 KiB