62362023-11-08 12:18:34SzorenyiZalanAndrasKarácsonyi égőkpython3Runtime error 0/1001.575s57884 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()
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted18ms11032 KiB
2Runtime error17ms11280 KiB
subtask20/15
3Runtime error50ms18024 KiB
4Accepted192ms18204 KiB
5Runtime error50ms18692 KiB
6Runtime error17ms12528 KiB
7Wrong answer17ms12868 KiB
subtask30/10
8Accepted17ms12772 KiB
9Wrong answer17ms12708 KiB
10Wrong answer17ms12832 KiB
11Accepted17ms13040 KiB
12Wrong answer17ms13072 KiB
subtask40/20
13Wrong answer17ms13332 KiB
14Wrong answer17ms13188 KiB
15Accepted17ms13080 KiB
16Accepted18ms13496 KiB
17Wrong answer17ms13820 KiB
subtask50/25
18Accepted222ms14780 KiB
19Wrong answer24ms14784 KiB
20Wrong answer25ms14916 KiB
21Wrong answer20ms14516 KiB
22Accepted23ms14188 KiB
subtask60/30
23Time limit exceeded1.572s28664 KiB
24Wrong answer155ms52380 KiB
25Wrong answer203ms57712 KiB
26Time limit exceeded1.552s29920 KiB
27Time limit exceeded1.575s30348 KiB
28Wrong answer202ms57884 KiB
29Wrong answer146ms52524 KiB
30Wrong answer136ms20552 KiB