6236 | 2023-11-08 12:18:34 | SzorenyiZalanAndras | Karácsonyi égők | python3 | Runtime error 0/100 | 1.575s | 57884 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[1])
a.remove(egok[0])
van=a
while kezd<n and veg<n-1:
if egok[kezd]==egok[veg]:
kezd+=1
else:
veg+=1
if (egok[veg] in van):
van.remove(egok[veg])
if len(van)==0 and veg-kezd<mo:
mo=veg-kezd+1
van.append(egok[kezd])
kezd+=1
print(mo)
main()
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 18ms | 11032 KiB | ||||
2 | Runtime error | 17ms | 11280 KiB | ||||
subtask2 | 0/15 | ||||||
3 | Runtime error | 50ms | 18024 KiB | ||||
4 | Accepted | 192ms | 18204 KiB | ||||
5 | Runtime error | 50ms | 18692 KiB | ||||
6 | Runtime error | 17ms | 12528 KiB | ||||
7 | Wrong answer | 17ms | 12868 KiB | ||||
subtask3 | 0/10 | ||||||
8 | Accepted | 17ms | 12772 KiB | ||||
9 | Wrong answer | 17ms | 12708 KiB | ||||
10 | Wrong answer | 17ms | 12832 KiB | ||||
11 | Accepted | 17ms | 13040 KiB | ||||
12 | Wrong answer | 17ms | 13072 KiB | ||||
subtask4 | 0/20 | ||||||
13 | Wrong answer | 17ms | 13332 KiB | ||||
14 | Wrong answer | 17ms | 13188 KiB | ||||
15 | Accepted | 17ms | 13080 KiB | ||||
16 | Accepted | 18ms | 13496 KiB | ||||
17 | Wrong answer | 17ms | 13820 KiB | ||||
subtask5 | 0/25 | ||||||
18 | Accepted | 222ms | 14780 KiB | ||||
19 | Wrong answer | 24ms | 14784 KiB | ||||
20 | Wrong answer | 25ms | 14916 KiB | ||||
21 | Wrong answer | 20ms | 14516 KiB | ||||
22 | Accepted | 23ms | 14188 KiB | ||||
subtask6 | 0/30 | ||||||
23 | Time limit exceeded | 1.572s | 28664 KiB | ||||
24 | Wrong answer | 155ms | 52380 KiB | ||||
25 | Wrong answer | 203ms | 57712 KiB | ||||
26 | Time limit exceeded | 1.552s | 29920 KiB | ||||
27 | Time limit exceeded | 1.575s | 30348 KiB | ||||
28 | Wrong answer | 202ms | 57884 KiB | ||||
29 | Wrong answer | 146ms | 52524 KiB | ||||
30 | Wrong answer | 136ms | 20552 KiB |