6237 | 2023-11-08 12:28:00 | SzorenyiZalanAndras | Karácsonyi égők | python3 | Wrong answer 0/100 | 1.6s | 57636 KiB |
def main():
n,l=map(int,input().split())
egok=list(map(int,input().split()))
kezd=0
veg=1
mo=99999999999999
van=[]
a=[]
for i in range(l):
a.append(i)
a.remove(egok[0])
if (egok[1] in van):
a.remove(egok[1])
van=a
while kezd<n and veg<n:
if (egok[veg] in van):
van.remove(egok[veg])
if egok[kezd]==egok[veg] and veg!=kezd:
kezd+=1
else:
veg+=1
if len(van)==0 and veg-kezd<mo:
mo=veg-kezd
van.append(egok[kezd])
kezd+=1
print(mo)
main()
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 17ms | 10944 KiB | ||||
2 | Accepted | 17ms | 11236 KiB | ||||
subtask2 | 0/15 | ||||||
3 | Wrong answer | 148ms | 19308 KiB | ||||
4 | Accepted | 181ms | 19580 KiB | ||||
5 | Accepted | 182ms | 19848 KiB | ||||
6 | Wrong answer | 17ms | 11788 KiB | ||||
7 | Wrong answer | 17ms | 12068 KiB | ||||
subtask3 | 0/10 | ||||||
8 | Accepted | 18ms | 12376 KiB | ||||
9 | Wrong answer | 17ms | 12448 KiB | ||||
10 | Wrong answer | 17ms | 12428 KiB | ||||
11 | Accepted | 17ms | 12584 KiB | ||||
12 | Wrong answer | 17ms | 12600 KiB | ||||
subtask4 | 0/20 | ||||||
13 | Wrong answer | 17ms | 12832 KiB | ||||
14 | Wrong answer | 17ms | 12964 KiB | ||||
15 | Accepted | 17ms | 12828 KiB | ||||
16 | Accepted | 18ms | 13068 KiB | ||||
17 | Wrong answer | 17ms | 13036 KiB | ||||
subtask5 | 0/25 | ||||||
18 | Accepted | 221ms | 14300 KiB | ||||
19 | Wrong answer | 24ms | 14108 KiB | ||||
20 | Wrong answer | 25ms | 14192 KiB | ||||
21 | Wrong answer | 20ms | 13764 KiB | ||||
22 | Accepted | 21ms | 13424 KiB | ||||
subtask6 | 0/30 | ||||||
23 | Time limit exceeded | 1.6s | 28108 KiB | ||||
24 | Wrong answer | 150ms | 51972 KiB | ||||
25 | Wrong answer | 192ms | 57484 KiB | ||||
26 | Time limit exceeded | 1.56s | 29896 KiB | ||||
27 | Time limit exceeded | 1.541s | 29944 KiB | ||||
28 | Wrong answer | 195ms | 57636 KiB | ||||
29 | Wrong answer | 137ms | 52480 KiB | ||||
30 | Wrong answer | 128ms | 22136 KiB |