?
# | Author | Problem | Lang | Verdict | Time | Memory | Sent | Judged | |
---|---|---|---|---|---|---|---|---|---|
35886383 |
Practice: ______i______ |
616D - 18 | PyPy 2 | Accepted | 202 ms | 54816 KB | 2018-03-03 16:45:01 | 2018-03-03 16:45:01 |
R=lambda:map(int,raw_input().split()) n,k=R() c=[0]*(1<<20) a=R() i,j=0,0 x,y=0,0 u,v=0,0 while j<n: c[a[j]]+=1 if 1==c[a[j]]: y+=1 j+=1 while y>k: c[a[i]]-=1 if 0==c[a[i]]: y-=1 i+=1 if j-i>x: x,u,v=j-i,i,j print u+1,v
?
?
?
?