2354 | 2023-01-10 22:43:47 | kristof | Karácsonyi égők | python3 | Time limit exceeded 30/100 | 1.6s | 29772 KiB |
from sys import maxsize
N, C = map(int, input().split())
L = list(map(int, input().split()))
tempL = list((0 for i in range(N)))
tempLCounter = 0
shortest = maxsize
shortestTemp = 0
for i in range(N):
tempLCounter = 0
tempL = list((0 for i in range(N)))
shortestTemp = 0
for j in range(i, N):
shortestTemp += 1
if int(tempL[L[j]]) == 0:
tempL[L[j]] += 1 # type: ignore
tempLCounter += 1
if tempLCounter == C:
maxsize = min(maxsize, shortestTemp)
break
print(maxsize)
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 17ms | 11064 KiB | ||||
2 | Accepted | 16ms | 11444 KiB | ||||
subtask2 | 0/15 | ||||||
3 | Time limit exceeded | 1.6s | 9316 KiB | ||||
4 | Time limit exceeded | 1.575s | 9484 KiB | ||||
5 | Time limit exceeded | 1.567s | 9744 KiB | ||||
6 | Accepted | 287ms | 12256 KiB | ||||
7 | Accepted | 268ms | 12712 KiB | ||||
subtask3 | 10/10 | ||||||
8 | Accepted | 17ms | 12540 KiB | ||||
9 | Accepted | 17ms | 12780 KiB | ||||
10 | Accepted | 17ms | 12888 KiB | ||||
11 | Accepted | 17ms | 12884 KiB | ||||
12 | Accepted | 17ms | 13084 KiB | ||||
subtask4 | 20/20 | ||||||
13 | Accepted | 90ms | 13336 KiB | ||||
14 | Accepted | 76ms | 13216 KiB | ||||
15 | Accepted | 65ms | 13224 KiB | ||||
16 | Accepted | 98ms | 13224 KiB | ||||
17 | Accepted | 72ms | 13276 KiB | ||||
subtask5 | 0/25 | ||||||
18 | Time limit exceeded | 1.554s | 6716 KiB | ||||
19 | Time limit exceeded | 1.547s | 6612 KiB | ||||
20 | Time limit exceeded | 1.567s | 6940 KiB | ||||
21 | Time limit exceeded | 1.57s | 6728 KiB | ||||
22 | Time limit exceeded | 1.562s | 6696 KiB | ||||
subtask6 | 0/30 | ||||||
23 | Time limit exceeded | 1.583s | 28644 KiB | ||||
24 | Time limit exceeded | 1.564s | 25872 KiB | ||||
25 | Time limit exceeded | 1.569s | 28480 KiB | ||||
26 | Time limit exceeded | 1.552s | 29772 KiB | ||||
27 | Time limit exceeded | 1.56s | 29712 KiB | ||||
28 | Time limit exceeded | 1.56s | 28576 KiB | ||||
29 | Time limit exceeded | 1.559s | 25944 KiB | ||||
30 | Time limit exceeded | 1.559s | 11804 KiB |