General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
223262029 Practice:
vjudge3
616D - 18 PyPy 2 Accepted 248 ms 33916 KB 2023-09-13 21:22:25 2023-09-13 21:22:25
→ Source
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
          	 	 				   			 	 		 	
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details